How to debug Interop?

  • Thread starter Thread starter Hitesh
  • Start date Start date
H

Hitesh

Hi all,
I am migrating from VB6 to ASP.NET. My VB6 code is using
MSScriptControl to execute some VBScript. I added
reference to MSScriptControl in .NET web application. This
created Interop.MSScriptControl.dll

Look at the line 10 and 13 in the source below.

1 Dim myscriptcontrol As New
MSScriptControl.ScriptControl()
2 Dim strScript As String
3 Try
4 myscriptcontrol.UseSafeSubset = True
5 myscriptcontrol.Language = "VBScript"
6
7 strScript = "dim a, b, c" & vbCrLf
8 strScript = strScript & "a = 2 " & vbCrLf
9 strScript = strScript & "b = 3 " & vbCrLf
10 strScript = strScript & "stop" & vbCrLf
11 strScript = strScript & "c = a+b" & vbCrLf
12
13 myscriptcontrol.AddCode(strScript)
14
15 Catch .....
16 ...

Line 13 executes and script stored in the variable
strScript

In VB6 when the "stop" statement is encountered (see Line
10), it starts the debugger and let me debug the VBScript.
But the same code in .NET is not invoking debugger.

...NET code is not generating any error it is executing the
script well. Only problem is I am not able to debug the
script executed by ScriptControl.

I also downloaded msscript.pdb and copied it to system
folder, also I have environment variable _NT_SYMBOL_PATH
set correctly, but still no luck.

If any one knows the solution or have any suggestions,
please let me know.

Thanks in advance,
Hitesh
 
Back
Top