开发者

C# Precompile affects line numbers?

开发者 https://www.devze.com 2023-04-03 07:09 出处:网络
I\'m trying to debug a problem in prod from a reported stack trace, but the line numbers aren\'t lining up? Do precompiles affect line numbers, and does the code in the \"else\" (as it were) count tow

I'm trying to debug a problem in prod from a reported stack trace, but the line numbers aren't lining up? Do precompiles affect line numbers, and does the code in the "else" (as it were) count toward line numbers?

For exampl开发者_Go百科e:

1    #if DEBUG
2    DoItemA();
3    #else
4    DoItemB()
5    #endif

So is that 2 lines of code (when compiled), 5 lines of code, or 1 line of code (the only line calculated to pertinent at pre-compile)

When that runs, and my stack trace says the error was on line 3, how did it count line numbers?


There is no separate precompiler in C#. So the line numbers in the stack-trace should be identical to the line numbers in the original file.

0

精彩评论

暂无评论...
验证码 换一张
取 消