105
votes

Is there an attribute I can use on a method so that when stepping through some code in Debug mode the Debugger stays on the outside of the method?

3

3 Answers

181
votes
14
votes

Not forgetting to add:

using System.Diagnostics;
9
votes

It's written <DebuggerStepThrough> in VB.NET.

To use it just put on top of the method like :

<DebuggerStepThrough>
Private Sub form_Paint(sender As Object, e As PaintEventArgs) Handles form.Paint
     ' Picasso
End Sub