Home All Groups Group Topic Archive Search About

Debugging a COM Interop Class Library

Author
22 Nov 2006 12:04 AM
Greg
I have a very simple Visual Basic .NET 2003 class library project
ClassLibrary1 configured to run an external program (in this case
C:\WINDOWS\system32\wscript.exe), in the Debugging Configuration Properties
Dialog Box with command line arguments C:\test.vbs. When I run the project, I
get an "unable to start debugging" error "unable to start program
'C:\WINDOWS\system32\wscript.exe'".

Why do I get this error and how can I solve it?

The Class Library is very simple

Public Class Class1
    Public Sub Test()
        Stop
        MsgBox("Test")
    End Sub
End Class

C:\test.vbs contains (if that matters):

msgbox "Here"
Set objApplication = Wscript.CreateObject("ClassLibrary1.Class1")
objApplication.Test

I selected the Build Configuration Properties Register for COM Interop
checkbox, because wscript.exe is unmanaged code.

I am running Windows XP Professional Service Pack 2.

Author
22 Nov 2006 5:20 AM
Cor Ligthert [MVP]
Greg,

Maybe you can add the process in the debugger. Be aware that it than has to
run before you can attach it. Be as well aware that there probably is no
source code availalable, so you only see the calls.

Cor

Show quoteHide quote
"Greg" <G***@discussions.microsoft.com> schreef in bericht
news:E9F6B258-CED0-473C-8B82-471AF31CE952@microsoft.com...
>I have a very simple Visual Basic .NET 2003 class library project
> ClassLibrary1 configured to run an external program (in this case
> C:\WINDOWS\system32\wscript.exe), in the Debugging Configuration
> Properties
> Dialog Box with command line arguments C:\test.vbs. When I run the
> project, I
> get an "unable to start debugging" error "unable to start program
> 'C:\WINDOWS\system32\wscript.exe'".
>
> Why do I get this error and how can I solve it?
>
> The Class Library is very simple
>
> Public Class Class1
>    Public Sub Test()
>        Stop
>        MsgBox("Test")
>    End Sub
> End Class
>
> C:\test.vbs contains (if that matters):
>
> msgbox "Here"
> Set objApplication = Wscript.CreateObject("ClassLibrary1.Class1")
> objApplication.Test
>
> I selected the Build Configuration Properties Register for COM Interop
> checkbox, because wscript.exe is unmanaged code.
>
> I am running Windows XP Professional Service Pack 2.
Author
22 Nov 2006 5:43 PM
Greg
I have no idea what you just said.

Show quoteHide quote
"Cor Ligthert [MVP]" wrote:

> Greg,
>
> Maybe you can add the process in the debugger. Be aware that it than has to
> run before you can attach it. Be as well aware that there probably is no
> source code availalable, so you only see the calls.
>
> Cor
>
> "Greg" <G***@discussions.microsoft.com> schreef in bericht
> news:E9F6B258-CED0-473C-8B82-471AF31CE952@microsoft.com...
> >I have a very simple Visual Basic .NET 2003 class library project
> > ClassLibrary1 configured to run an external program (in this case
> > C:\WINDOWS\system32\wscript.exe), in the Debugging Configuration
> > Properties
> > Dialog Box with command line arguments C:\test.vbs. When I run the
> > project, I
> > get an "unable to start debugging" error "unable to start program
> > 'C:\WINDOWS\system32\wscript.exe'".
> >
> > Why do I get this error and how can I solve it?
> >
> > The Class Library is very simple
> >
> > Public Class Class1
> >    Public Sub Test()
> >        Stop
> >        MsgBox("Test")
> >    End Sub
> > End Class
> >
> > C:\test.vbs contains (if that matters):
> >
> > msgbox "Here"
> > Set objApplication = Wscript.CreateObject("ClassLibrary1.Class1")
> > objApplication.Test
> >
> > I selected the Build Configuration Properties Register for COM Interop
> > checkbox, because wscript.exe is unmanaged code.
> >
> > I am running Windows XP Professional Service Pack 2.
>
>
>
Author
22 Nov 2006 8:12 PM
Cor Ligthert [MVP]
Greg,

Have a look in the debug button in top to "Attach to process"

Cor

Show quoteHide quote
"Greg" <G***@discussions.microsoft.com> schreef in bericht
news:169ED764-66DA-4F3B-85D7-0A44E2DE0C91@microsoft.com...
>I have no idea what you just said.
>
> "Cor Ligthert [MVP]" wrote:
>
>> Greg,
>>
>> Maybe you can add the process in the debugger. Be aware that it than has
>> to
>> run before you can attach it. Be as well aware that there probably is no
>> source code availalable, so you only see the calls.
>>
>> Cor
>>
>> "Greg" <G***@discussions.microsoft.com> schreef in bericht
>> news:E9F6B258-CED0-473C-8B82-471AF31CE952@microsoft.com...
>> >I have a very simple Visual Basic .NET 2003 class library project
>> > ClassLibrary1 configured to run an external program (in this case
>> > C:\WINDOWS\system32\wscript.exe), in the Debugging Configuration
>> > Properties
>> > Dialog Box with command line arguments C:\test.vbs. When I run the
>> > project, I
>> > get an "unable to start debugging" error "unable to start program
>> > 'C:\WINDOWS\system32\wscript.exe'".
>> >
>> > Why do I get this error and how can I solve it?
>> >
>> > The Class Library is very simple
>> >
>> > Public Class Class1
>> >    Public Sub Test()
>> >        Stop
>> >        MsgBox("Test")
>> >    End Sub
>> > End Class
>> >
>> > C:\test.vbs contains (if that matters):
>> >
>> > msgbox "Here"
>> > Set objApplication = Wscript.CreateObject("ClassLibrary1.Class1")
>> > objApplication.Test
>> >
>> > I selected the Build Configuration Properties Register for COM Interop
>> > checkbox, because wscript.exe is unmanaged code.
>> >
>> > I am running Windows XP Professional Service Pack 2.
>>
>>
>>
Author
22 Nov 2006 8:55 PM
Greg
No, I'm not debugging a process. I'm debugging a Class Libbrary. A Windows
Script application just happens to create the class library object.

Show quoteHide quote
"Cor Ligthert [MVP]" wrote:

> Greg,
>
> Have a look in the debug button in top to "Attach to process"
>
> Cor
>
> "Greg" <G***@discussions.microsoft.com> schreef in bericht
> news:169ED764-66DA-4F3B-85D7-0A44E2DE0C91@microsoft.com...
> >I have no idea what you just said.
> >
> > "Cor Ligthert [MVP]" wrote:
> >
> >> Greg,
> >>
> >> Maybe you can add the process in the debugger. Be aware that it than has
> >> to
> >> run before you can attach it. Be as well aware that there probably is no
> >> source code availalable, so you only see the calls.
> >>
> >> Cor
> >>
> >> "Greg" <G***@discussions.microsoft.com> schreef in bericht
> >> news:E9F6B258-CED0-473C-8B82-471AF31CE952@microsoft.com...
> >> >I have a very simple Visual Basic .NET 2003 class library project
> >> > ClassLibrary1 configured to run an external program (in this case
> >> > C:\WINDOWS\system32\wscript.exe), in the Debugging Configuration
> >> > Properties
> >> > Dialog Box with command line arguments C:\test.vbs. When I run the
> >> > project, I
> >> > get an "unable to start debugging" error "unable to start program
> >> > 'C:\WINDOWS\system32\wscript.exe'".
> >> >
> >> > Why do I get this error and how can I solve it?
> >> >
> >> > The Class Library is very simple
> >> >
> >> > Public Class Class1
> >> >    Public Sub Test()
> >> >        Stop
> >> >        MsgBox("Test")
> >> >    End Sub
> >> > End Class
> >> >
> >> > C:\test.vbs contains (if that matters):
> >> >
> >> > msgbox "Here"
> >> > Set objApplication = Wscript.CreateObject("ClassLibrary1.Class1")
> >> > objApplication.Test
> >> >
> >> > I selected the Build Configuration Properties Register for COM Interop
> >> > checkbox, because wscript.exe is unmanaged code.
> >> >
> >> > I am running Windows XP Professional Service Pack 2.
> >>
> >>
> >>
>
>
>