1

I have a small logging method that I don't want to step through in normal debugging sessions in Visual Studio. I thought that there was an attribute to mark methods in a way that the debugger would automatically skip over them, but I can't find it in MSDN, and my googling hasn't turned up anything useful. Am I misremembering things? Is there an attribute that does this?

Reacher Gilt
  • 1,813
  • 12
  • 26

1 Answers1

9

There is an attribute you can use called DebuggerStepThrough (MSDN):

using System.Diagnostics

...

[DebuggerStepThrough]
public void MyMethod() {
    ...
Fenton
  • 241,084
  • 71
  • 387
  • 401