Is there a way to skip code without having to set a breakpoint after it? I am using the debugging to explore code with a GUI painting event that runs lots of times. I wish to see what comes after the event is done triggering without having to click next a bunch of times.
C# – Visual Studio 2008 Debugging – Skipping code
cdebuggingvisual studio
Related Topic
- Visual-studio – How to count the lines of code in a Visual Studio solution
- Git – .gitignore for Visual Studio Projects and Solutions
- Visual-studio – Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio
- Visual-studio – How to auto format code in Visual Studio
- C# – Writing to output window of Visual Studio
- Asp.net-mvc – Visual Studio debugging/loading very slow
- JQuery selector help – Can I generate a selector from clicking on an element
Best Answer
When this attribute is attached to a constructor/method/property or indexer then that code is hidden from the debugger, it will not be possible for you to step into the code, the debugger will just skip over the code. Even if you set a breakpoint inside one of the pieces of code decorated with this attribute, the debugger will ignore it.
This attribute is the same as the DebuggerHiddenAttribute, apart from the fact that you can set a breakpoint inside the code which has been decorated with the DebuggerStepThroughAttribute, and the debugger will stop at the breakpoint.
This attributes marks a section of code as not being user code, you can then use this with the Tools->Options->Debugging->General->Enable Just My Code, option to tell the debugger not to step into the decorated code.