Why would the debugger not be stopping at a breakpoint in my ASP.NET application?

前端 未结 15 2188
独厮守ぢ
独厮守ぢ 2020-12-05 12:46

I\'m trying to debug a large ASP.NET application.

I set a breakpoint on the first line in Page_Load in Default.aspx.cs.

When I start the application, my

15条回答
  •  长情又很酷
    2020-12-05 13:35

    In my case, the issue ending up being related to both using full IIS (not Express) and having a debug build where it included full debug symbols but also had project properties, Build, Optimize code checked.

    Under Express, this works fine, but under full IIS this doesn't work. Visual Studio attaches to the w3wp process correctly, but it does not load symbols for the optimized dll. In Visual Studio you can go to Debug, Windows, Modules then scroll for the specific dll and see if under the Symbol Status column it shows Skipped Loading Symbols.. Right-click on it and select Load Symbols to make it work.

    One additional setting that can affect this is if Visual Studio is set to only debug user code under Debug, Options and Settings, Debugging, General, Enable Just My Code. When optimized, the dlls will be marked as not user code when running under full IIS, so when Just My Code is enabled any breakpoints in them will be skipped. You can either set VS to debug non-user code or set the build to not optimize to allow breakpoints to be hit.

提交回复
热议问题