How To: Debug a .NET DLL ?

R

Rob R. Ainscough

I've created several DLL's that I use in other projects. I "Add Reference"
to these other projects pointing to my DLL. Probelm is, I can't seem to be
able to step into my DLL code (from these other projects) -- I've tried
adding the source code project (that was used to build the DLL) into my
current solution, but I still can't seem to step into the code of my DLL.

Any suggestion?

I must be missing something simple?

Thanks, Rob.
 
P

Patrick Steele [MVP]

I've created several DLL's that I use in other projects. I "Add Reference"
to these other projects pointing to my DLL. Probelm is, I can't seem to be
able to step into my DLL code (from these other projects) -- I've tried
adding the source code project (that was used to build the DLL) into my
current solution, but I still can't seem to step into the code of my DLL.

Any suggestion?

Are the other DLL's compiled in debug mode?

Does the PDB file that gets generated during a debug compile exist in
the same directory as the DLL?
 
R

Rob R. Ainscough

Patrick,

Yes and Yes.

I assume that I am supposed to add the DLL source code project/assembly to
my primary solution? Is there anything else I need to do?

In my case:

I have a Windows Service, that references a couple of other DLL's I created.
I have no problem debugging my Windows Service solution (i.e. using Debug
Process, select the running service, attach, etc.), but no matter what I do,
I can't seem to step into the DLL code that is called from my Windows
Service.

Do I need to resort to other methods as it seems debugging DLL's in a
Windows Service is just not supported?

I'll code a Windows Form app to test the DLL and see if this is just an
issue with DLLs in Windows Services -- it shouldn't be, but...

Rob.
 
R

Rob R. Ainscough

Update:

I ran a test project (standard Windows Form) loading the my DLL (Add
Reference) and loaded the DLL source code project -- this worked, I could
step into the DLL code.

So, it appears that stepping into DLL code via a Windows Service project
using the Debug Processes is just not supported. Unless someone has some
insights that I'm missing?

Rob.

Rob R. Ainscough said:
Patrick,

Yes and Yes.

I assume that I am supposed to add the DLL source code project/assembly to
my primary solution? Is there anything else I need to do?

In my case:

I have a Windows Service, that references a couple of other DLL's I
created. I have no problem debugging my Windows Service solution (i.e.
using Debug Process, select the running service, attach, etc.), but no
matter what I do, I can't seem to step into the DLL code that is called
from my Windows Service.

Do I need to resort to other methods as it seems debugging DLL's in a
Windows Service is just not supported?

I'll code a Windows Form app to test the DLL and see if this is just an
issue with DLLs in Windows Services -- it shouldn't be, but...

Rob.
 
P

Patrick Steele [MVP]

I have a Windows Service, that references a couple of other DLL's I created.
I have no problem debugging my Windows Service solution (i.e. using Debug
Process, select the running service, attach, etc.), but no matter what I do,
I can't seem to step into the DLL code that is called from my Windows
Service.

Where is this DLL located? In the GAC?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top