Visual Studio 2015 project no longer runs in debug mode

后端 未结 22 1176
萌比男神i
萌比男神i 2020-12-04 18:32

This is what I get even when I run in the Debug configuration:

The way I got this to show was by enabling "Just My Code" and warn if there

相关标签:
22条回答
  • 2020-12-04 19:20

    Copying my other answer from here.

    As mentioned by @romanoza, Microsoft has updated the bug report with the following information:

    Uncheck the setting Debug -> Options -> Suppress JIT optimization on module load (Managed only)

    This is the workaround. They go on to say later:

    We recommend folks leaving it unchecked as having it unchecked will improve both performance and the behavior of just my code in specific scenarios.

    Lastly, the acknowledgement:

    It is a bug that it doesn't work with that setting enabled and we're working on a fix for that situation in case some customers still want to debug with that setting turned on.

    0 讨论(0)
  • 2020-12-04 19:21

    In case you just need to keep going without any further delays, select the last option from the popup and all will run the same as before.

    0 讨论(0)
  • 2020-12-04 19:23

    If none of mentioned solutions has helped, check your project's AssemblyInfo.cs for explicit DebuggableAttribute application. It seems like it overrides compiler's debug/release options.

    I had this line in the file in my case (legacy project, no idea how it got there). Deleting it solved the problem:

    [assembly: System.Diagnostics.Debuggable(System.Diagnostics.DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
    
    0 讨论(0)
  • 2020-12-04 19:23

    Just adding a side note to stuartd's answer:

    Be sure you check any dependent projects for the same build settings. You will get the same message prompt if your main project has the proper settings, but your dependent projects do not. It makes obvious sense in hindsight, but it wasn't the first thing to come to mind.

    0 讨论(0)
  • 2020-12-04 19:23

    This was a weird alert.

    Rebuilding the Solution won't necessarily clear all the DLL files (especially ones copied from dependent projects).

    However, rebuilding the dependency project made this alert go away.

    I faced this with Visual Studio 2015 Update 3.

    0 讨论(0)
  • 2020-12-04 19:24

    Select menu DebugOptions and unselect the Suppress JIT optimization option. It works for me.

    Source: https://connect.microsoft.com/VisualStudio/feedback/details/2116788/flag-optimize-is-passed-to-the-debugger-even-while-the-build-settings-optimize-code-is-not-enabled-on-mvc-c-web-projects-when-using-just-my-code

    0 讨论(0)
提交回复
热议问题