Visual Studio breakpoints not being hit

后端 未结 19 2159
再見小時候
再見小時候 2020-12-04 18:59

I\'m working with an ASP.NET MVC project that seems to be having some issues when attaching to the IIS process (w3wp.exe). I\'m running the solution and IIS 8.5 on my own lo

19条回答
  •  余生分开走
    2020-12-04 19:39

    If none of the above work, double-check your code. Sometimes the reason why the breakpoint appears to not be hitting is due to the block of code containing the breakpoint is not being executed for sometimes inadvertant reasons.

    For example, forgetting the "Handles Me.Load" has gotten me a few times when copying and pasting code:

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        --this block of code will not execute
        End Sub 
    

    vs

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        --this block executes
        End Sub
    

提交回复
热议问题