How do debugg a .net dll

T

tony.johansson

Hello!

I have a solution that create a class library dll.
I have also a solution where the main is located so this solution create a
exe file.

Now to my question if I want to debug the dll do I then have to add the dll
project to the solution where the main is located.

//Tony
 
A

Arne Vajhøj

I have a solution that create a class library dll.
I have also a solution where the main is located so this solution create
a exe file.

Now to my question if I want to debug the dll do I then have to add the
dll project to the solution where the main is located.

Other will have to answer the question you asked.

I will just point out that I would choose another
strategy:
* write extensive unit tests for the class library to
find most of the bugs before another project
consumes it
* if necessary to track down the bug use the debugger
in the class library project
* modify the class library to use a logging framework
like log4net (or NLog or Enterprise Library or whatever
you prefer) to be able to trace what is going on inside
the class library

Arne
 
A

Arno

Hello!

I have a solution that create a class library dll.
I have also a solution where the main is located so this solution create a
exe file.

Now to my question if I want to debug the dll do I then have to add the dll
project to the solution where the main is located.

//Tony

Hello Tony,

If I well understood your question, you wrote a dll, referenced it in
an exe project,
and your goal is to debug your dll when you run your exe application.
You have two ways to do it :
- As you said, you can add the dll to your exe solution and
referenced the dll project
from your exe application
- You can also open the dll project, run your application, and
attach the application process
to your dll ==> Go to debug menu, choose attach to process, and in the
list choose the application
process
 

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