3

In VS 2017 , When trying to do the build, I'm getting You are debugging a release build for ASP.NET C# project.

My build is Debug.

The solution for the similar reported issue for VS2015, which is to Enable Just My Code does not work here.

=======

No , I tested the solution above , it DOES NOT solve the problem in VS2017!

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
S Nash
  • 2,363
  • 3
  • 34
  • 64
  • 3
    Possible duplicate of [VS 2015 Update 1 - Claiming I am debugging a release build](https://stackoverflow.com/questions/34028341/vs-2015-update-1-claiming-i-am-debugging-a-release-build) – Fuzzybear Jul 02 '18 at 15:00
  • Please read Above! This is for VS2017 so this is a totally different product. – S Nash Jul 02 '18 at 15:04
  • Also as I said the solution in that POST does not work for VS2017. – S Nash Jul 02 '18 at 15:04
  • 1
    No, it's not a completely different product, at all. The answer has a comment indicating it doesn't work for VS2017. Just because it isn't solved doesn't mean it's not a duplicate – Camilo Terevinto Jul 02 '18 at 15:06
  • It is different enough so the VS2015 solution does not work here. – S Nash Jul 02 '18 at 15:07
  • Try by Disabling this option under Debug > Options >Suppress JIT optimization on module load (Managed only). – Prany Jul 02 '18 at 15:21
  • @Prany. it did not work. – S Nash Jul 02 '18 at 16:16
  • @SNash - Have you also disable the Optimize code checkbox under build properties of the project ? – Prany Jul 02 '18 at 16:32

3 Answers3

3

Batch Clean and Rebuild works for me.

Steps:

  1. Right Click Solution in Solution Explorer and Select Batch Build
  2. Select Select All and then Clean
  3. Repeat 1
  4. Select Select All and then Rebuild

OR

"Release" option may have been selected in the "Solution Configurations" which is present between "Redo" and 'Solution Platforms" menu. Select "Debug" option and you are good to go.

20B2
  • 2,011
  • 17
  • 30
2

I had the "You're debugging a release DLL" issue in an older .Net project. In the properties for the project, where I was getting the error, under on the build tab had the option "Optimize Code" checked. Unchecking this option solved this problem for me:

Properties of the project file in Visual Studio

Devin
  • 88
  • 1
  • 9
0

Check your Configuration Manager and set both/all profiles to Debug for now.

Clean the solution, manually deleting the folders if you have to.

Restart visual studio.

Try again.

And the final solution... deploy your code anyway, then point a remote debugger at the 'live' site :)

Davesoft
  • 724
  • 1
  • 4
  • 10