?
Solved

Debugging VB.NET DLL when called from another process

Posted on 2004-05-02
13
Medium Priority
?
214 Views
Last Modified: 2010-04-24
Hi There

Using Vb.net 2003

I need to be able to debug a vb.net DLL as follows:

- When I set a breakpoint (f9) it actually stops on the line
- When the program does an err.raise it actually stops on the line

At the moment it runs through regardless. I can put stop statements in and that will break it into the debugger, but the Err.raise always just executes the error handler, it doesn't break. And f9 breakpoint lines are just ignored.

I've gone into Exceptions and changed "When the Exception is Handled" to "Break into the Debugger"

The DLL is being called from ASP3 (not ASP.NET) (that is, its a COM enabled DLL)
0
Comment
Question by:plq
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
13 Comments
 
LVL 21

Accepted Solution

by:
tovvenki earned 800 total points
ID: 10974752
Hi,
have alook at this msdn location
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsdebug/html/vc_Debugging_Your_Application_home_page.asp.
It has more information that might helpyou to solve your problem

Regards,
Venki
0
 
LVL 8

Author Comment

by:plq
ID: 11020431
thanks for the link  (:-))

I'm still having problems with this. I've tried all MS's suggestions from the above link

I can fire the debugger by putting a stop, for example, in the Logon code, once its in the debugger thats great, it will pick up any future exceptions. But from a productivity point of view I need to have the debugger fire up on exceptions without having to put a Stop statement in.

The MS site explains the problem clearly, that the debugger must actually attach to the process. The problem is, you don't know which dllhost.dll is going to fire up the dll, so you don't know which one to attach to.

The MS article says "Start debugging the server as a normal application", but how can you start a DLL ? When you try to start it, you get the error : "A project with an Output Type of Class Library cannot be started directly"
0
 
LVL 6

Expert Comment

by:Mafalda
ID: 11023284
Your application might be running threads preventing you from following it all the way.
I suggest using the old printing tecnique to track the problematic section.
Also you could try to add an error handler and trace back the origin of the error
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Author Comment

by:plq
ID: 11023512
Hi Mafalda,

Thanks for this. I don't understand what you mean. The problem is that the debugger is not automatically fired when the original thread raises an exception.

My program is not launching threads explicitly. What do you mean by "old printing technque" ? I can easily find the line of code that is causing a particular bug, The problem is, I spend a lot of time debugging and I need to break on an exception within my DLL without having to explicitly attach to a process, I want the debugger to fire up immediately when an exception is raised.

0
 
LVL 6

Expert Comment

by:Mafalda
ID: 11023534
I missed the point.
You are talknig about a VS.NET (VB.NET) setup issue ... not a bug tracking issue ...
Is the DLL part of your project/solution ?
0
 
LVL 8

Author Comment

by:plq
ID: 11023588
the DLL is written in vb.net, has a COM wrapper and is called from old ASP pages (not asp.net). You can't control which dllhost.exe process actually fires the dll.

[lets not get into an asp.net conversion discussion, this project has 280 asp pages and the DLL has 100K+ lines of vb]

The only problem I am concerned with here is not being able to break automatically when an exception is raised. Effectively, its a developer productivity issue. In VB6 you can run the dll without compiling from the IDE, you can set "break on all errors", and when an error occurs, you get the debugger right on the  line of code raising the error.

In .net there is no such luxury, you have to run iisreset which takes 20 seconds and you have to recompile on each code change, and I can't even break on an exception without doing another iisreset, insert a stop statement somewhere, and start the whole debugging process again. In practice this take programming with .NET  to a productivity level of about one tenth that of the old vb6. We might as well convert to C++, forget .net and enjoy the benefits of platform independence and performance enjoyed by c++ based apps

OK, this is getting emotional. All I want is the ability to break on an exception without putting in a stop statement and not knowing which process invokes the com component....
0
 
LVL 8

Author Comment

by:plq
ID: 11066256
I've still not found a solution to this.

I need to know how to make the .net debugger automatically attach to a process and break when the process raises an error.
0
 
LVL 6

Expert Comment

by:Mafalda
ID: 11099700
No objection
0
 
LVL 8

Author Comment

by:plq
ID: 11118393
modulo,
Actually the link from tovvenki is useful to people researching, so maybe award 100 or 200 points grade A and refund the rest ?
0
 
LVL 8

Author Comment

by:plq
ID: 11146254
Its the first comment

Comment from tovvenki
Date: 05/03/2004 06:06AM BST

200 pts grade A please !

thanks a lot
Paul
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question