Link to home
Start Free TrialLog in
Avatar of AidenA
AidenA

asked on

debugging dll files in a .NET project

I have a .NET project which contains a dll which I have created myself. Now, there is some problem, either in my calling code, or in the dll, but I can't figure out what it is because I can't debug the dll for some reason.

Now, I don't know why, but I have added that dll to other projects, and when an error occurs, the debugger opens up the dll and automatically debugs it. In this project, however, for some reason it just says 'there is no source code for this location' or something to that effect and the dll can't be opened or debugged (or at least, I'm not sure how to do it if it doesn't happen automatically). If I alter something in the dll outside of the project, the project that can debug the dll even tells you something has changed and asks if you want to load the changes into the dll that is part of the project.

What's the difference between the two projects?
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Are you referencing just the DLL, or have you added teh class library project to your solution and added a project reference?
Avatar of AidenA
AidenA

ASKER

well i don't remember if i did it any different way the first time. But usually i just right click on the project and select 'add reference' and the browse to where my dll is and then add it... so i guess i'm just referencing the dll.

or is there a chance i'm doing something else also in the other projects? how can i tell, if that's the case.
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello,

You first add the custom control dll project into your opened project as a add existing project. Then put there debug point and debug the software. It is working.
Avatar of AidenA

ASKER

Yeap thanks Carl... that was it. Didn't think about that. Think I used the release version because the debug version didn't update when I built the project. So, I just tried to run the project and there was an error because you can't run a dll but it still built the debug version anyway and so i replaced with that.

Now i can step through it ok... thanks again

Aiden