VS 2015 Update 1 - Claiming I am debugging a release build

Visual Studio-2015

Visual Studio-2015 Problem Overview


After updating to VS 2015 update 1, if I run a web project (MVC), stop the application, then try to run it again, VS stops and pops up a dialog claiming

> You are debugging a Release build of <myproject.dll>. > > Using Just My Code with release builds using compiler optimizations results in a degraded debugging experience (e.g. breakpoints won't be hit).

The problem is I'm not running a release build. I'm clearly running the (same) debug build I just ran! Why does VS think I'm running a release build?

Cleaning the solution and re-running clears the error message, so something is hosed somewhere.

Visual Studio-2015 Solutions


Solution 1 - Visual Studio-2015

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.

Solution 2 - Visual Studio-2015

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.

Solution 3 - Visual Studio-2015

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: https://stackoverflow.com/questions/31992705/vs2015-project-no-longer-runs-in-debug-mode

Thanks,

Solution 4 - Visual Studio-2015

I solved the problem setting the configuration to Debug in the Configuration Manger window as suggested in this answer.

enter image description here

Solution 5 - Visual Studio-2015

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.

Solution 6 - Visual Studio-2015

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.

Solution 7 - Visual Studio-2015

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.

Solution 8 - Visual Studio-2015

In my case, I had changed the "Active solution platform" for the whole solution at "Configuration Manager" from x86 to Any CPU, fixed the problem

Solution 9 - Visual Studio-2015

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.

Solution 10 - Visual Studio-2015

I noticed that Visual Studio wasn't killing the iisexpress process after I stopped the debugger. Manually killing the process seemed to fix it for me.

This appears to have now been fixed in Update 2.

Solution 11 - Visual Studio-2015

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.

Solution 12 - Visual Studio-2015

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.

Solution 13 - Visual Studio-2015

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.

Solution 14 - Visual Studio-2015

For me, I found 3 \Release\ folder refs in this FileListAbsolute.txt file:

C:\Projects\MyWebApp.Web\obj\Release\MyChildWebApp.Web.csproj.FileListAbsolute.txt

They were like this:

C:\Projects\MyWebApp.Web\obj\Release\MyChildWebApp.Web.csprojResolveAssemblyReference.cache

C:\Projects\MyWebApp.Web\obj\Release\MyChildWebApp.Web.dll

C:\Projects\MyWebApp.Web\obj\Release\MyChildWebApp.Web.pdb

And simply removing those 3 lines outside of VS then re-opening the solution solved the problem. Hope that helps.

Solution 15 - Visual Studio-2015

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.

Solution 16 - Visual Studio-2015

Restart Visual Studio. This fixed the issue for me in 2017 Professional.

Solution 17 - Visual Studio-2015

Here is what worked for me.

If a web project, Go to the project properties of the web project and

  1. If Local IIS is selected, restart your IIS server.
  2. If IIS Express is selected, exit IIS express from the task tray icon.

It seems some dll's get cached so the above steps will invalidate the cache.

Solution 18 - Visual Studio-2015

Pretty sure this has been fixed in Visual Studio 2015 Update 2.

I used to see this all the time (multiple times per day), and have not seen it once since updating to Update 2.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohn TView Question on Stackoverflow
Solution 1 - Visual Studio-2015John TView Answer on Stackoverflow
Solution 2 - Visual Studio-2015Nate CookView Answer on Stackoverflow
Solution 3 - Visual Studio-2015cesar-moyaView Answer on Stackoverflow
Solution 4 - Visual Studio-2015fabriciorissettoView Answer on Stackoverflow
Solution 5 - Visual Studio-2015romanozaView Answer on Stackoverflow
Solution 6 - Visual Studio-2015JonView Answer on Stackoverflow
Solution 7 - Visual Studio-2015BpsView Answer on Stackoverflow
Solution 8 - Visual Studio-2015Mak RView Answer on Stackoverflow
Solution 9 - Visual Studio-2015user5632285View Answer on Stackoverflow
Solution 10 - Visual Studio-2015AlexView Answer on Stackoverflow
Solution 11 - Visual Studio-2015CrowcoderView Answer on Stackoverflow
Solution 12 - Visual Studio-2015Randy RichardsonView Answer on Stackoverflow
Solution 13 - Visual Studio-2015Andy TwissView Answer on Stackoverflow
Solution 14 - Visual Studio-2015Ian_GView Answer on Stackoverflow
Solution 15 - Visual Studio-2015JohnZView Answer on Stackoverflow
Solution 16 - Visual Studio-2015TomDaneView Answer on Stackoverflow
Solution 17 - Visual Studio-2015CodingYoshiView Answer on Stackoverflow
Solution 18 - Visual Studio-2015Jerad RoseView Answer on Stackoverflow