Lỗi you are debugging a release build of mutilshop.dll

I'm trying to debug a VS extension, when i click on "Local Window Debugger" for the first time, I get this message:

I have no idea wtf is this, I'm not on Release, I have "Debug" selected, I have tried both:

Disable Just MyCode and Continue

Continue Debugging

But anything I modify in the project is not compiled, whatever line I modify and recompile, it still uses old data as if nothing had been modified.

I also tried everything from here: //stackoverflow.com/questions/38601643/error-you-are-debugging-a-release-build-of-x-dll

VS 2022 17.6.5

1 answer

2023-07-18T02:45:17.9+00:00

I have figured out what was happening, the extension installed on VS had been compiled as Release, and I was trying to debug it.

I uninstalled the extension and then installed the debug, it was my fault for not paying attention to this basic thing but… that message should be more clear about this.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

How to: Debug a Release Build

  • Article
  • 08/03/2021

In this article

You can debug a release build of an application.

To debug a release build

  1. Open the Property Pages dialog box for the project. For details, see Set C++ compiler and build properties in Visual Studio.
  2. Click the C/C++ node. Set Debug Information Format to C7 compatible [/Z7] or Program Database [/Zi].
  3. Expand Linker and click the General node. Set Enable Incremental Linking to No [/INCREMENTAL:NO].
  4. Select the Debugging node. Set Generate Debug Info to Yes [/DEBUG].
  5. Select the Optimization node. Set References to /OPT:REF and Enable COMDAT Folding to /OPT:ICF.

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.

If an application works in a debug build, but fails in a release build, one of the compiler optimizations may be exposing a defect in the source code. To isolate the problem, disable selected optimizations for each source code file until you locate the file and the optimization that is causing the problem. [To expedite the process, you can divide the files into two groups, disable optimization on one group, and when you find a problem in a group, continue dividing until you isolate the problem file.]

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Pick a username Email Address Password

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have an ASP.NET MVC application project, along with various other projects within a Visual Studio solution. The different projects use various versions of the NPoco library as follows:

  • The MVC project includes a version of NPoco through NuGet.
  • Some other projects include a [probably different] version of NPoco through a reference to a DLL [not the DLL provided through NuGet].
  • One of the projects is the source code of a version of NPoco with some alterations made.

I'm using Visual Studio 2015 Update 3 14.0.25422.01.

Error

For some reason, when I launch this application in the debugger using the normal Start Debugging command in Visual Studio, it launches, but it also produces the following warning:

If I press Continue Debugging, everything seems to still work as usual, including breakpoints.

This problem only started happening recently.

Question

  1. Anyone know what caused the above error?
  2. Do I have something misconfigured?

asked Jul 26, 2016 at 23:53

NOCARRIER

2,4755 gold badges41 silver badges59 bronze badges

answered Jul 27, 2016 at 11:44

Jack ZhaiJack Zhai

6,2981 gold badge12 silver badges20 bronze badges

8

"Optimize code" option is there on visual studio project level. Remove that for debug mode.

answered Sep 24, 2018 at 10:47

3

I also encountered the similar problem in Visual Studio 2019 Following Steps solved my issue Debug-> Options->Uncheck Enable Just my code option

answered Jun 19, 2020 at 13:22

SnehaSneha

4484 silver badges10 bronze badges

2

Just had a similar issue that I was able to fix by Cleaning my solution 3 times and rebuilding. Hope this helps other people too.

answered Jun 28, 2017 at 20:18

tokyo0709tokyo0709

1,9174 gold badges28 silver badges49 bronze badges

0

Right click on your solution and select Properties.

Then, go to Configuration Properties on the left and select Configuration under it. Make sure that the Configuration of the project you are running is in 'Debug' and not in 'Release'.

If the Configuration is in 'Release' you would get this error.

answered Aug 5, 2020 at 7:40

StarLordStarLord

7871 gold badge8 silver badges23 bronze badges

3

This happened to me while using NuGet packages.

Let's say you want to debug code from Project1...

If you have a Project1 NuGet package referenced in any of the projects in the solution [.sln], make sure you remove it. Instead of adding Project1's NuGet package, add Project1 [.csproj] directly as a reference to any given project that needs Project1 in the solution. This way you'll be able to step through code while debugging and Visual Studio won't bark about "Release" version anymore.

If Project1 is from a different solution [.sln], you can right click your current solution and select Add existing item... pick Project1.csproj for example. Then go to any project that needs Project1 \=> right click => Add => Reference and pick Project1.

answered Mar 4, 2020 at 18:44

Leniel MaccaferriLeniel Maccaferri

101k46 gold badges372 silver badges484 bronze badges

1

I have found that when you update a Nuget package that has a dependency on a referenced project [that you may have modified version] it replaces this with the Nuget version of the dll.

To fix this after updating [or adding] you nuget package you need to remove the reference to the dll [e.g. NPoco] and the add a project reference to the project with your modified version.

answered Jan 29, 2017 at 3:21

TrtlBoyTrtlBoy

66914 silver badges17 bronze badges

4

In my case, I had Optimize code checked for my Debug build configuration. Make sure this is unchecked for all Debug configurations across all projects.

answered Jul 28, 2022 at 11:26

John LivermoreJohn Livermore

30.5k46 gold badges129 silver badges216 bronze badges

In my case some tricky trickster put this into the AssemblyInfo.cs file:

[assembly: Debuggable[DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints]]

Commented it out and it started working

answered Oct 3, 2019 at 22:09

Adam PlocherAdam Plocher

14.1k6 gold badges49 silver badges82 bronze badges

1

answered Apr 26, 2022 at 10:46

1

Right click solution > Properties > Configuration Manager > Active solution configuration : New Give a name to new solution configuration. Copy setting from "Debug".

I did everything for this error but just this solution worked.

barbsan

3,42811 gold badges21 silver badges28 bronze badges

answered Aug 21, 2019 at 8:35

In case someone is still having this issue, for me it was because I confused the GAC by installing the software I was trying to debug.

The fusion logger helped me figure this out ha.

answered Dec 8, 2017 at 16:05

In my case I removed

[assembly: System.Diagnostics.Debuggable[true, false]]

4 for my project and removed contents in release folder. Rebuild project again and it works for me.

Fabrizio

7,8836 gold badges45 silver badges107 bronze badges

answered Apr 7, 2018 at 7:10

Another reason for this problem is the following "assembly-level" attribute:

[assembly: System.Diagnostics.Debuggable[true, false]]

[I found this out only by accident....who checks AssemblyInfo.cs when one experiences such problems....right - nobody]

Edit: just saw that someone else added this already..... [with other parameters though] - also - the reason for this attribute was also "decompile from exe" [we lost source-code for that particular project :-/ ]

answered Jan 29, 2020 at 16:21

I had the same issue after moving my projects to a new machine.

Downloading the proper Target framework worked for me. My project uses .Net Framework 4.7.2 and the error went away after downloading .Net Framework 4.7.2.

answered Jul 16, 2020 at 18:59

user1619768user1619768

531 gold badge1 silver badge7 bronze badges

Short answer [FIX]:

Enable the option to Suppress JIT optimization on module load in Tools->Options->Debugging->General

The reason: If you are trying to debug code, it is easier when that code is NOT optimized. When code is optimized, the compiler and runtime make changes to the emitted CPU code so that it runs faster, but has a less direct mapping to original source code. If the mapping is less direct, debuggers are frequently unable to tell you the value of local variables, and code stepping and breakpoints might not work as you expect.

How it works: The debugger exposes an option that controls what happens when a DLL that is compiled with optimizations enabled loads inside of the target process. If this option is unchecked [the default state], then when the .NET Runtime compiles the MSIL code into CPU code, it leaves the optimizations enabled. If the option is checked, then the debugger requests that optimizations be disabled.

More info

answered Aug 30, 2022 at 8:45

This happened to me in VS2017, even after changing the configuration to Build. The issue was resolved when restarting VS2017

answered May 24, 2019 at 9:25

ElayamathyElayamathy

1892 silver badges5 bronze badges

This is one of typical Microsoft errors that could have 20 solutions. For me, I rebooted my server that was running visual studio 2017 and it fixed the issue.

answered Feb 11, 2020 at 22:07

PhillyNJPhillyNJ

3,8594 gold badges38 silver badges64 bronze badges

I encountered this problem [in Visual Studio 2017] for the first time today. For me, it turned out to be caused by a different version of my application, built in Release mode, running under the same application pool in IIS that I was debugging with. I gave the different version of the application its own application pool and the problem disappeared.

answered Feb 13, 2020 at 15:13

This started happening randomly in the middle of the day for me.

Tried Clean, deleted all BIN and OBJ folders... nothing worked.

I had to stop/start the IIS application pool for the ASP.NET solution to fix it.

answered Dec 24, 2020 at 22:42

Glen LittleGlen Little

6,9784 gold badges48 silver badges70 bronze badges

Had some advanced settings in

[assembly: System.Diagnostics.Debuggable[true, false]]

5. After deleting, it worked

answered Mar 17, 2022 at 6:46

SzilardDSzilardD

1,6512 gold badges22 silver badges40 bronze badges

  1. Close VS
  2. Delete all bin & obj folders inside your project

PowerShell snippet for deleting all bin and obj folders and files:

Get-ChildItem .\ -include bin,obj -Recurse | foreach [$_] { remove-item $_.fullname -Force -Recurse }

answered Nov 17, 2022 at 8:17

Kaloyan DrenskiKaloyan Drenski

9701 gold badge13 silver badges18 bronze badges

1

One common case is not mentioned in the existing answers:

When Debugging a "chain" of referenced dlls, all of the dlls must be referenced from the first dll in the chain.

As an example, let's say we have this structure:

A.dll, which references:
  B.dll, which references: 
    C.dll

In this example, if we want to debug

[assembly: System.Diagnostics.Debuggable[true, false]]

6, the current reference chain is not enough, and we must make

[assembly: System.Diagnostics.Debuggable[true, false]]

7 reference

[assembly: System.Diagnostics.Debuggable[true, false]]

6 as well:

A.dll, which references both:
  1. B.dll, which references: C.dll
  2. C.dll

answered May 14 at 19:16

OfirDOfirD

9,7836 gold badges49 silver badges95 bronze badges

I kept getting this "error" even though I changed the Configuration dropdown to "Debug" which didn't work. I eventually clicked on Build > Configuration Manager and changed it to "Debug" and the error went away.

answered Aug 9 at 2:59

Hugh SeagravesHugh Seagraves

5941 gold badge8 silver badges14 bronze badges

Close and Restart visual studio worked for me

answered Apr 4, 2021 at 13:37

After reading through the myriad solutions above, I exited from VS and restarted it. Yes, that's right, I turned if off and on again. And, yes, it worked.

answered Aug 16, 2022 at 16:30

Just select "Continue Debug [don't ask again]"

This is how it has always worked. They added this new message for the newbies that don't realize that debugging does not work [that well] when optimizations are used [like in release mode]

Chủ Đề