I am developing a DLL using C# .NET 2.0 and Visual Studio 2008 Professional. I would like to debug (i.e. set a breakpoint in) it using Attach to Process and attaching it to the application's executable. I think this is working; at least, I'm not getting any error messages. However, any breakpoints that I try to set get disabled with a little warning message on them stating, "The breakpoint will not currently be hit. No symbols have been loaded for this document." Any thoughts on how I can get debugging with breakpoints working would be much appreciated. Unfortunately, I cannot simply run the application from VS because of the complex nature of its install process; I need to somehow attach the DLL to the installed executable (I can switch the file out, if need be) and debug with breakpoints. Thanks.
+1
A:
Hi,
Make sure you have a debug version of the code you're trying to attach to. If it's a release version with no pdb files you will get the error you're describing. Also make sure you have have the correct type selected in the "Attach to" selector. The selector should be set to Automatic or Managed.
Enjoy!
Doug
2010-09-20 14:30:46
The "Attach to" selector was set to Automatic. I changed it to Managed, and it started working. Thanks!
Jim Fell
2010-09-20 14:58:47
A:
If you are sure you have a debug build and the source code matches the build you are attaching to, then check your Debug - Windows - Modules window, and check all the locations for the assemblies you are debugging, their versions, and pdb locations. This will help you narrow down the issue.
Richard Hein
2010-09-20 14:48:25