I have a VS Solution with some breakpoints. When I attach the solution to a third-party program the breakpoints are omitted ("The breakpoint will not currently be hit. No symbols have been loaded for this document"). Confusingly breakpoints of any (referenced) project that are not within my solution are hit, only those within my own solution are not. So when interacting the third-party tool I cannot debug through my projects. I also tried out this but the problem still occurs. I also re-built the whole solution to re-recreate the DEBUG-information-files for the projects. The location is the same as for the other solutions, but apparently its contained information is not loaded. Any ideas why?
-
Have you tried replacing the DLL and PDB files on the bin folder of the third party program with the output of your local build in DEBUG mode? Also, the symbols are first loaded when your assembly is hit, so, make sure the third party calls your assemblies at least once before the symbols are loaded. – Gerardo Grignoli Jul 15 '14 at 15:20
-
Have you tried restarting visual studio? Also I would try 'delete all breakpoints'. – anthonybell Jul 15 '14 at 15:20
-
Sometimes I come across a project that for whatever reason doesn't fully clean out the bin folder when building. Try manually deleting the contents of your bin folder. – RichardMc Jul 15 '14 at 15:28
-
@Gerardo why should I copy the DLL and PDB to the 3rd party tool? Did not for the solutions either, so I´d wonder if this is the issue (but maybe the tool itself references the directory of my DLLs in background, I suppose so). The third-party tool actually hits the assembly, I get message-boxes that I created within my project (way before may breakpoints). – MakePeaceGreatAgain Jul 15 '14 at 15:34
-
@anthon and Richard: I also cleaned the solutions bin-folder and all of its breakpoints :( – MakePeaceGreatAgain Jul 15 '14 at 15:38
-
@HimBromBeere To be sure that VS and the 3rd party program are using the same binaries and correct debug symbols. I supposed that the program already has a copy of the DLL, so this was a double check for the DLL and the PDB. Where is the program getting your DLL from? Also, your DLL is not in the GAC, right? – Gerardo Grignoli Jul 15 '14 at 15:56
-
@GerardoGrignoli There is a dialog within the program where I can add functionality from existing external resources by entering a DLL or type-library (TLB)-file (which is exactly the one I formerly rebuilt from the project). The DLL is not in the GAC also. I recently reset this file to the most recent built of my assembly. Somethings weird seems going on... – MakePeaceGreatAgain Jul 16 '14 at 07:05
-
Obviously - what I read from http://msdn.microsoft.com/en-us/library/vstudio/4c8f14c9.aspx - my assembly is not listed within the modules at all. ??? – MakePeaceGreatAgain Jul 16 '14 at 07:27
2 Answers
Finally I found the answer in this post. I took a look into the loaded modules (Debug->Windows->Modules while having assembly attached to process) and noticed that my actual assembly wasn´t in the list. The code I wanted to debug is built with .NET 3.5 but modules have only been loaded for .NET 4.0. Usually this might be detected automatically as far as I am concerned but however this time automatic detection did not work for some weird reason so I changed selected code type from managed (v4.0) to managed (v2.0) and now it works. Hope this won´t occur when I have to debug on .NET 4.0 later again...

- 1
- 1

- 35,491
- 6
- 60
- 111
You can try these answers too if problem exists after.
Referring to : First answer or see : Second answer
Start debugging, as soon as you've arrived at a breakpoint or used Debug > Break All
, use Debug > Windows > Modules
. You'll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information. You'll get a dialog that lists all the directories where it looked for the .pdb file for the assembly. Verify that list against the actual .pdb location. Make sure it doesn't find an old one.
In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe. The bin\Debug folder of your project. Make sure you remove one from the GAC if you've been playing with it.

- 1,119
- 3
- 17
- 28