Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

debugging a dll

Status
Not open for further replies.

VBdevil

Programmer
Sep 19, 2002
75
IL
Hi,

I have a dll and a C# application that uses that dll. My problem is that I want to debug my dll, and can't managae to do so.

For example - my application calls a function called open() which is defined in the dll, and I want to debug the open() function, but it won't let me...
By the way, I have a reference to the dll in the project, and also I tried putting a breakpoint inside the open() function...

How can I debug this function?

Thanks
 
Load both your exe and dll projects into one solution. You should then be able to step into the dll call.

BTW, make sure you check the parameters to the open() call. If a calculated parameter can't be resolved prior to the call, you'll see this sort of error. In this case, split the calculated parameter out, and store it in it's own variable.

From this:
Code:
bool bRez = SomeObject.Open(Response.Read(0,0), MyStream);
to this:
Code:
int r = Response.Read(0,0);
bool bRez = SomeObject.Open(r, MyStream);
This will allow you to see if Response.Read returned a good value.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Thanks for your help. It works now.

One more question though. I have an application written in vb.net and a dll written in C#. I tried to debug the dll in the same way as above (I loaded both projects into the same solution), but it doesn't recognize the breakpoint in the dll... Have any ideas why?
 
As far as I am aware, you wont be able to mix languages in the VS IDE until VS 2005.

Hope this helps
 
Hmm, @VBdevil, break-points seems to work on my machine (on Debug build). One thing I can't do is the "Go To Definition" when I'm trying to locate a method definition from my VB frontend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top