In Delphi the compiler directives {$d-} and {$l-} allow you to effectively avoid generation of debug and local variable information for a defined section of code.
In a practical matter that has the effect to "hide" the code from the debug view, it doesn't appear in the call stack and you don't step into it while debugging.
Is there any way to achieve the same result in c# using VS 2008?
Note: The reason is we have a stable framework which does not need to be debugged but tend to mess up with the call stack and with the standard debug flow.
I use DebuggerNonUserCodeAttribute so that you by default do not break or step into the code; However, the benifit to this over DebuggerStepThrough is that you can go to the Options->Debugger->Just My Code setting and allow breaking/debugging of the code you marked. This helps significantly if you have issues. I typically use it on entire classes.
BTW, the call stack will automatically hide non-user code as marked with this attribute :) Of course you can simply right-click the call stack window and toggle "Show External Code" to hide/show the missing stack information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With