Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 999
John T Avatar asked Dec 01 '15 19:12

John T


People also ask

How do I change Debug to Release in Visual Studio?

On the toolbar, choose either Debug or Release from the Solution Configurations list. From the Build menu, select Configuration Manager, then select Debug or Release.

Can you Debug a Release build?

You can now debug your release build application. To find a problem, step through the code (or use Just-In-Time debugging) until you find where the failure occurs, and then determine the incorrect parameters or code.

What is the difference between a Debug build and a Release build?

The Debug configuration of your program is compiled with full symbolic debug information which help the debugger figure out where it is in the source code. Is Release mode is faster than Debug mode ? The Release mode enables optimizations and generates without any debug data, so it is fully optimized. .

How do I turn off debugging in Visual Studio?

To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.


2 Answers

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.

like image 79
John T Avatar answered Sep 20 '22 15:09

John T


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.

like image 42
Nate Cook Avatar answered Sep 19 '22 15:09

Nate Cook