views:

29

answers:

4

Hi,

I created my .net class library, I have registsred the assembly and I am invoking the methods in the .net class library from VB Script file, I want to debug the code in the class library when methods are invoked from vb script file.

Could you please help in doing the above

A: 

I'm not sure if that's possible. You can set Visual Studio up to debug a Class library via an executable, but I don't think it allows a script and I'm not sure if there's some way to get around that.

If you don't actually need the script and would be happy to just debug it manually you can do it via The Immediate Window as described on this page Debugging DLL Projects. There might be something else on that page that would help you find out how to do it from a script as well.

ho1
Thanks a lot for your response, We are under procees of migrating vb apps to vb.net, so the methods in vb dll when invoked from vb script file, if there is any run time error automatically the vb IDE will be popped up with focus on line where the error occured, so we need the same thing happening in vb .net, if it is working in vb i hope we can make the same thing working from .net
Shravan
@Shravan: That's slightly different from how I read your first question. I think that if you only want it to pop up on errors you could do that by using the debug versions of the Class Library and it should ask you if you want to debug when an unhandled exception occurs and if you choose yes it should open up the project and show you where the error occured (the first time you'd probably have to show it where the source code is.
ho1
A: 

Visual studio has an attach to proccess option in the debug menu. If you use this and select the process that the vbscript is running you should be able to debug it.

mattythomas2000
A: 

If you have the source code for the .net DLL (and from the sounds of it you do), you can add this to the beginning of where you want to debug:

Debugger.Launch()

This will cause a dialog to be shown when that line is hit allowing you to pick an instance of Visual Studio to debug with. From there you can step through the code as normal.

Pondidum
A: 

Why not add a "Debug" property which gives you verbose exception handling and diagnostic output to file/event log?

It's probably the easiest option.

carlsb3rg