I need to debug a class library project that is provided to the main project (an ASP.NET website) as a DLL. For example, I need to put some breakpoints in order to check what’s happening during the execution.
I tried How to: Debug from a DLL Project, unfortunately it didn’t work…
How can I do it?
PS: I have the source code!
Debugging DLLs in Visual Studio (see #2 in the list) may be what you’re looking for (full disclosure: Yes, this is my personal web site).
With method #1, you can’t watch variables.
With method #2, step #2, if you can’t open the project in the same Visual Studio instance, you can run the binary of the project (that is, run it outside of Visual Studio, but make sure you run the debug version.) and attach the Visual Studio debugger to it (menu Debug -> Attach to Process).
Here are the steps for method #2 so no one has to follow the link:
Attaching a using process to the DLL project. This involved hooking the Visual Studio debugger into a running process.
application can’t be run from
another instance of Visual Studio since the
process will already have a debugger
attached to it.
the DLL code loaded in Visual Studio (although
the breakpoint will appear disabled
the same as in method 1).