A symbol file does not load to debug a custom project in Visual Studio 2012

I have a great solution in Visual Studio 2012 that consists of executables and class library projects. When debugging an application, breakpoints in one particular project do not get class libraries.

I looked at the Debug> Windows> Modules window to check the status of characters for this project, and it says "Cannot find or open PDB file . "
He also says “No” in the “User Code” column.
I notice that there are several other user projects in the solution that show “No” in this column, and their characters are also not loading. Everything that has “Yes” in the “User Code” section does not seem to have loaded pdb. But I'm not sure if this is relevant.

I used dumpbin / headers in the dll and the path to the pdb file is present and fixed.

The module, of course, is not included in the list of exceptions for loading a character.

I also tried right-clicking on the entry in the module window, selecting "Download Symbols" and navigating to the path indicated in the dll header. When I select pdb, it says "The corresponding character file was not found in this folder .

I get this after I delete these folders and files, clear the solution, close it and rebuild it all. Pdb was definitely built at the same time as the DLL.

Thus, the problem is that part of the "cannot open pdb" error message is part of the message.

I tried this on two computers and they both exhibit the same behavior.

Can someone suggest any suggestions on where to go from here, and perhaps why the built-in pdb corresponding to the dll will not be loaded on the ground?

+52
c # visual-studio visual-studio-2012 msbuild
Aug 07 '13 at 17:11
source share
17 answers

I tried several tools to check if pdb and dll were actually mapped, and using chkmatch , I could see that the GUIDs in the DLL were starting and the pdb in the obj folder did not match.

So, it turns out that although the dll and pdb in the obj folder of the project are a coincidence, the DLL that was actually copied to the application’s destination folder with the post-build event was the old dll from the previous assembly.

The post-build event was fired before this particular project built, or at least finished construction, and copied to the existing dll from the bin, which was subsequently overwritten by the ongoing build.

I solved the problem by editing the project dependencies for the solution and ensuring that the project with the event after the build depends on the project that was not loaded and now loads pdb during debugging.

+38
Aug 08 '13 at
source share

I just deleted the bin and obj folder from the startup project folder and restored the solution.

+31
Dec 12 '14 at 1:31 on
source share

For me, I just deleted the project from IIS and created it again, and it works great

+10
Jan 17 '15 at 6:47
source share

For me, it helped to use the chkmatch tool, and then just close and open the visual studio, do a clean and rebuild. Now my pdb is also loading. You can make sure that this is how Nangidrin pointed out from Debug -> Windows -> Modules - this view is only available during debugging.

+9
Apr 10 '14 at 8:56
source share

In my case, an older version of the reference dll was in my GAC. Dumped it and it worked.

+7
Apr 29 '15 at 18:52
source share

I found that the project I was getting the message about was optimized when building.

I turned on project properties, the Compilation tab, Advanced Compilation Options ... and uncheck Enable Optimizations

Uncheck Enable Optimization

+6
Jul 14 '16 at 14:55
source share

Reminder: add the project to the "Debug" configuration ... for those who love me and forget me and are stupid.

+3
May 03 '16 at 14:38
source share

Removed the project from the solution and added it again to the solution that worked for me. :)

+2
Aug 6 '15 at 8:12
source share

A bit late for the party here - just in case it is useful.

We have several separate sites (in different solutions in Visual Studio). During the initial loading of one of the sites, we turned to another site that would return an image.

Both of these sites referred to a common DLL, but while working on one site, they did not understand that the other site was left in the "Release" assembly - after loading the site, the damaged DLL was rebuilt, but without characters.

Kudos to Nangidrin for mentioning the module debug window (very useful) and for putting me on the right track with the post build event.

+2
Sep 24 '15 at 14:35
source share

The answer is from another thread that worked for me: stack overflow
- In Visual Studio: Project Properties → Build → Advanced button → Debug Information and make sure that the value is not "none".

+1
Feb 23 '16 at 15:27
source share

I had this problem, and I thought that I could fix it, as this will help others (maybe even me again ?!) in the future ...

Make sure that when you connect to a process on a remote server, the Attach To option is set to

Automatically detect type of code for debugging

To do this, when a server identifier is provided and a list of processes is displayed, click the "Select" button next to the "Attach to" input.

Image 1 Then select "Automatically detect code type for debugging" and OK off the screen, then attach.

Image 2
This at least solved the problem for me.

+1
Sep 09 '16 at 13:07 on
source share

In my case, the Enable Just My Code checkbox was checked in Tools>>Options>>Debugging>>General .

I unchecked the box and it worked.

Image example

+1
Aug 11 '18 at 13:57
source share

In my debug window, I had a line like this:

Symbols for module "MyModule.dll" were not loaded.

I removed the "Optimize code" parameter in the project properties -> Assembly. And the error has disappeared.

0
Jan 17 '17 at 7:51 on
source share

This problem may be caused by the incorrect dlls link used in the project.

Remove the obj and bin folders in the current project and build .

0
Feb 03 '17 at 13:23
source share

Check the permission for the ASP.NET temporary folder:

 "c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files" 

An application pool user must have rights to a subfolder with ASP.NET files, for example:

 root\60039743\c28e12ee 
0
Apr 19 '18 at 13:09 on
source share
  1. Check the options from this answer: stack overflow
  2. Click Advanced, and verify that Debug Information is set to FULL.
    Advanced tab screenshot
  3. Check Run Configuration in all projects in solution
0
Nov 01 '18 at 17:26
source share

I had this problem, tried all other solutions (it took 2 days! I pay ...! TWO DAYS!) But, finally, I realized that my file was registered in the GAC, I deleted it and the problem was solved.

At the command prompt, enter the following command:

 gacutil –u <assembly name> 

How to remove an assembly from the global assembly cache

0
Jun 15 '19 at 9:30
source share



All Articles