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!
If you have the source code, and the .pdb files in your BIN directory, then you can debug through that code. However, You will need to enable external code debugging in Visual Studio.
You need to uncheck the "Enable Just My Code" option: menu Tools --> Options --> Debugging --> Enable Just My Code
NOTE: This will only work for .NET assemblies.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With