How to debug external class library projects in visual studio?
Assume the path of
Project A
C:\Projects\ProjectA
Project B
C:\Projects\ProjectB
and the dll of ProjectB is in
C:\Projects\ProjectB\bin\Debug\
To debug into ProjectB
from ProjectA
, do the following
- Copy
B
's dll with dll's.PDB
to theProjectA
's compiling directory. - Now debug
ProjectA
. When code reaches the part where you need to call dll's method or events etc while debugging, pressF11
to step into the dll's code.
NOTE : DO NOT MISS TO COPY THE .PDB FILE
Try disabling Just My Code (JMC).
- Tools > Options > Debugging
- Uncheck "Enable Just My Code"
By default the debugger tries to restrict the view of the world to code that is only contained within your solution. This is really heplful at times but when you want to debug code which is not in your solution (as is your situation) you need to disable JMC in order to see it. Otherwise the code will be treated as external and largely hidden from your view.
EDIT
When you're broken in your code try the following.
- Debug > Windows > Modules
- Find the DLL for the project you are interested in
- Right Click > Load Symbols > Select the Path to the .PDB for your other project