[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Debugging VB.NET DLL when called from another process

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
plq
Asked:
plq
  • 6
  • 3
1 Solution
 
tovvenkiCommented:
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
 
plqAuthor Commented:
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
 
MafaldaCommented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
plqAuthor Commented:
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
 
MafaldaCommented:
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
 
plqAuthor Commented:
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
 
plqAuthor Commented:
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
 
MafaldaCommented:
No objection
0
 
plqAuthor Commented:
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
 
plqAuthor Commented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now