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
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.
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.
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)]
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.
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.
Select menu Debug → Options 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