skfd
skfd

Reputation: 2596

How to make custom Visual Studio configuration debuggable?

For every project in solution there is a custom configuration Dev, how can I make it debuggable like Debug сonfiguration?

Upvotes: 0

Views: 32

Answers (1)

Mike Makarov
Mike Makarov

Reputation: 1356

There are 2 possible issues here (two since I assume you're trying to set a breakpoint on the code that actually participates in compilation, not e.g. .NetFramework code... and since you didn't specify a language I hope it's C# or VB.net).

  1. The PDBs are not generated. To fix: on each project in solution you need bereakpoints to be active, go to project Properties -> Build tab -> (at thew very end of property sheet, possibly you'll need to scroll) click Advanced button. In the dialog that appeared, set Debug Info ==> Full. Rebuild the solution (Build -> Rebuild solution).
  2. The PDBs are in place but the loaded image does not correspond to debug information available. If the 1st method doesn't help, launch a debug session again. Now go to Debug > Windows > Modules. Sort the table to see the paths of the DLLs loaded. Check paths of DLLs produced by your projects. It is possible that these dlls are loaded from GAC or other registered places. If so - you'll need to either uninstall the app in question, or manually remove DLLs from GAC, or do some other tricks. Anyway, if this is the case - I recommend to consult other team members working on this code.
    • It might be that the module is not initially loaded and you have to make some actions to your app to trigger this. Then the breakpoint will activate.
    • If module is loaded from correct path, but breakpoints don't work anyway, stop debugging, reboot PC (yes, I'm not joking), manually clear ALL .\bin and .\obj folders from solution, then launch Visual studio and rebuild solution again. Start debugging session and using Modules view ensure both module and it's symbols are loaded from correct location.

Upvotes: 1

Related Questions