C# desktop application on express edition. Worked then didn't work 5 seconds later.
I tried the following.
- Ensure debug configuration, debug flag, and full debug info are set on all assemblies.
- Delete all bin and obj folders and all DLLs related to the project from my entire machine.
- Recreate projects causing the problem from scratch.
- Reboot.
I have two WinForms projects in the solution. One of them loads the debug info, one doesn't. They both refer to the assembly I'm trying to get debug info on in exactly the same way in the project file. Any ideas?
I want to add in here, mostly for myself when I come back to review this question, that symbols are not loaded until the assembly is loaded, and the assembly is not loaded until it is needed. If the breakpoint is in a library that is only used in one function in your main assembly, the symbols will not be loaded (and it will show the breakpoint as not being hit) until that function is called.
Cross posting this fix from Hans K that I found on the similar thread >> HERE <<:
In my case "Optimize Code" was checked in my project properties. This caused VS to see my assembly as "not my code", and in turn, it did not load symbols for it.
The solution was to uncheck this.
I tried everything mentioned above, but nothing worked. [Clean solution, and check for PDB files etc.]
Even publishing the same solution did not resolve the issue.
Then I went to back to what I usually do to resolve (fool this stubborn Visual Studio)
All I did was to make a deliberate change in code and publish the solution. Then I reverted the change and published again.
Voila [PDB files rid of evil spirits].. Not a smart resolution, but this did work.. :-|
This took me a while tried other options above and for some strange reason debugging stopped working.
I was integrating a C# application with a static library using VS10 - which I'm new to. I wrote a managed code dll to interface them. I could set breakpoints everywhere but the static lib. I got the message described above - no symbols have been loaded for this document. I tried many of the suggestions above. I could see that the symbols weren't being loaded. I finally noticed a check box Configuration Debug, Enable unmanaged code debugging. That allowed me to set breakpoints in the static lib functions.
First try rebuilding your project by right mouse click the project > Rebuild If that doesn't work, try a clean of the project (right mouse click on the project > clean)
If that didn't work check this:
(step 6 generates the .pdb files, these are the debugging symbols)