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.
Just Check whether your solution is in Release Mode.
The selected answer led me to fix my problem. But I need to do a few things more:
Even with "Debug" selected in the dropdown:
And in the project Properties > Build:
The Visual Studio was not loading symbols to a specific project. So in that dropdown I select "Configuration Manager" and saw that the settings to my web project was incorrect:
Then I set that to "Debug" and it started to generate the
.pdb
file. BUT I need to manually copy the PDB and DLL and put in the folder that VS was looking (here is where the selected answer helped me):For an ASP.Net application, check the properties of the site, ASP.NET tab. Ensure that the correct ASP.NET version is selected.
I know I'm years late, but I thought I'd done something wrong and followed the above steps then I realised I'd set the solution configuration to 'Release' by mistake :)
Project Properties (then select your build config) > Build Tab > Advanced... > Debug Info (dropdown)
Set to 'all' or 'pdb-only' then rebuild
this happened to me after copy paste another webservice asmx file into an existing webservice, resulting in the same error when trying to debug the recently added service, to be able to debug I had to start without debug, then attach to the process. its weird but its the only way i found to be able to debug.