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
This has happened to me on a couple of projects too. I reviewed my build settings, as suggested by stuartd. However, 'Optimize code' was not enabled in my build settings. So I enabled it and saved the project. Then I unchecked it and saved again. Problem solved.
There's some kind of bug that causes the --optimize+
flag to be passed to the debugger. Enabling it and then disabling it is an easy workaround until the bug is fixed.
I had the same issue... No matter what I did - nothing worked.
It was an new empty project that was the problem. I ended up removing the project and adding a new project - the new project had to have another name; if I used the same name the error just reappeared - even after a reboot, clean and rebuild... It must be a bug in Visual Studio 2015.
Resolution steps:
Go to the Build settings of the offending project's Properties page.
Scroll right down to the “Advanced...” button.
Make sure “Debug Info:” is not set to “none”.
I recommend you to use the full option.
In my case the problem was that the IIS Project URL in my ASP.NET project properties web tab was set to the wrong URL.
It was pointing to http://localhost which I was using with a different copy of the project. The address for the solution I had open was actually configured on my local IIS as http://localhost:90.
Changing to the correct address fixed the problem.
I encountered this issue as well. The fix that worked for was to simply clean (Build > Clean Solution
) and rebuild (Build > Rebuild Solution
) my projects.
None of the previous answers worked for me. Restarting IIS fixed it.