C# - Attribute to Skip over a Method while Stepping in Debug Mode

后端 未结 3 1425
忘了有多久
忘了有多久 2021-01-30 12:29

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条回答
  • 2021-01-30 12:36

    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
    
    0 讨论(0)
  • 2021-01-30 12:43
     [DebuggerStepThrough]
    

    (docs)

    0 讨论(0)
  • 2021-01-30 12:55

    Not forgetting to add:

    using System.Diagnostics;
    
    0 讨论(0)
提交回复
热议问题