Debugging a COM Interop Class Library

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg

    #1

    Debugging a COM Interop Class Library

    I have a very simple Visual Basic .NET 2003 class library project
    ClassLibrary1 configured to run an external program (in this case
    C:\WINDOWS\syst em32\wscript.ex e), 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\sys tem32\wscript.e xe'".

    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.CreateO bject("ClassLib rary1.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.
  • Cor Ligthert [MVP]

    #2
    Re: Debugging a COM Interop Class Library

    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" <Greg@discussio ns.microsoft.co mschreef in bericht
    news:E9F6B258-CED0-473C-8B82-471AF31CE952@mi crosoft.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\syst em32\wscript.ex e), 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\sys tem32\wscript.e xe'".
    >
    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.CreateO bject("ClassLib rary1.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.

    Comment

    • Greg

      #3
      Re: Debugging a COM Interop Class Library

      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" <Greg@discussio ns.microsoft.co mschreef in bericht
      news:E9F6B258-CED0-473C-8B82-471AF31CE952@mi crosoft.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\syst em32\wscript.ex e), 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\sys tem32\wscript.e xe'".

      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.CreateO bject("ClassLib rary1.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.
      >
      >
      >

      Comment

      • Cor Ligthert [MVP]

        #4
        Re: Debugging a COM Interop Class Library

        Greg,

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

        Cor

        "Greg" <Greg@discussio ns.microsoft.co mschreef in bericht
        news:169ED764-66DA-4F3B-85D7-0A44E2DE0C91@mi crosoft.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" <Greg@discussio ns.microsoft.co mschreef in bericht
        >news:E9F6B25 8-CED0-473C-8B82-471AF31CE952@mi crosoft.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\syst em32\wscript.ex e), 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\sys tem32\wscript.e xe'".
        >
        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.CreateO bject("ClassLib rary1.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.
        >>
        >>
        >>

        Comment

        • Greg

          #5
          Re: Debugging a COM Interop Class Library

          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.

          "Cor Ligthert [MVP]" wrote:
          Greg,
          >
          Have a look in the debug button in top to "Attach to process"
          >
          Cor
          >
          "Greg" <Greg@discussio ns.microsoft.co mschreef in bericht
          news:169ED764-66DA-4F3B-85D7-0A44E2DE0C91@mi crosoft.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" <Greg@discussio ns.microsoft.co mschreef in bericht
          news:E9F6B258-CED0-473C-8B82-471AF31CE952@mi crosoft.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\syst em32\wscript.ex e), 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\sys tem32\wscript.e xe'".

          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.CreateO bject("ClassLib rary1.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.
          >
          >
          >
          >
          >
          >

          Comment

          Working...