Check your solution's Configuration Properties. I ran into the same problem and discovered that my debug configuration was actually building some projects with a release configuration.
I encountered the same problem. I resolved the problem by manually deleting all the files from the 'bin' folder and then rebuild the solution. I don't get this dialog anymore.
I've been having the same issue since updating to VS2015 Update 1.
Found a similar report on Microsoft's Visual Studio Forums which points to a bug report that's been raised with them here
There are various workarounds but I think the underlying issue is that IIS Express is not shutting down when debugging is ended - and its not because of the edit and continue option being unchecked. Quickest workaround I can find until the bug is fixed:
Right click on IIS Express icon in tray and exit it after debugging (Credit to David Totzke who supplied workaround on bug report)
Not great, but I don't think a proper solution is available at the moment.
The word from Microsoft is that this is a known issue (it originally went to the Debugger team, but was determined it was a build issue, and is now in the Project system team's hands. There are other bugs open on this issue, and it's rated Priority 1, so should be on track for the next update. Though as would be expected, no promises can be made as to when it will be released (or what is actually in the update).
So. It's known and is being worked on. At least turning off the “Enable Just My Code” in the Debugging General Options seems to be a work around for now.
Cleaning (and rebuilding) the solution works for me as a temporary workaround. Also you can select Debug > Options and unselect the Suppress JIT optimization checkbox.
As mentioned by @romanoza, Microsoft updated the (now missing) Microsoft Connect bug report, (previously located here, in case you are able to find an archive somewhere) 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.
Update: Based on the comments, it appears that the box is now unchecked by default for some developers, and that checking it can fix the exact same problem in some cases. Very strange.
I noticed the answers here are incomplete, I was having the same issue and it was solved by opening the project properties and under the build tab and debug configuration unchecking"optimize code". You also should check the configuration manager as mentioned above to make sure that is also sound. The answer came from this post and they should get the credit: VS2015 Project no longer runs in debug mode
Check that the IIS Project URL actually points where you think it does. If in doubt, click the 'Create Virtual Directory' button.
I had this issue recently where I had been running a temporary version of a production codebase and had repointed the folder in IIS to the temporary version, which was, indeed, running a production build, not the debug version I was trying to debug.
There seem to be as many solutions as there are people having the problem, but in my case I had to remove and re-add a project reference. The project reference was in a unit test project in the same solution.
I have tried all the answers, and the one worked for me is remove some NuGet package, not just the reference, but remove the package, in my case PostSharp. At first I tried to remove the reference from all the projects, and it doesn't work, then I just removed the packages from the manager. I don't what exactly the reason, but that's what solved my problems, hope it could help someone out there.
In my case, the error message was correct. I was running an application that loaded the released version. So I corrected it by having the application load the debug version instead.
Elementary, I know, and I realize I make myself look like an idiot. But sometimes the problem is exactly what is reported.