locked
"unable to attach to the process" - VS 2003 VB.NET dll and VB6 exe RRS feed

  • Question

  • I'm trying to debug a VB.NET dll that is used by a VB6 exe but every time I try to attach to the VB6 exe process i get a "unable to attach to the process" mesage from VS 2003.

    I start my VB6 exe project in debug and step to a break point where I have received a calculated value from the VB.NET dll. I then open my VB.NET dll project and try to attach to the VB6 exe process in CLR mode, at which point I get the message mentioned above.

    I've managed to do this in the past but I run into the same problem on two different systems. I've read threads where issues with netfx 1.1 and 2.0 seem to be the culprit but the work arounds mentioned there (forcing use of netfx 1.1 in app config etc....) aren't relevant to me as my exe is a VB6 app. 

    Can anyone confirm that what I am doing should work in theory? Does anyone have any suggestions as to how I can step through both my VB6 exe and my VB.NET dll in debug like I used to be able to do (it was very useful in the earlier stages of development of the VB.NET dll....)

    Thx.

    //C 

    Wednesday, September 13, 2006 7:26 AM

Answers

  • Your app may be vb6 but you still need to tell it to use the 1.1 version of the runtime.

    What you need to create is a vb6.exe.config file with the vb98 directory where the vb6.exe is located and tell it to use your 1.1 framework. something similar to the following. Hope this helps

    <configuration>

       <startup>
     <supportedRuntime version="v1.1.4322"/>
       </startup>

    </configuration>

    Friday, September 15, 2006 6:29 PM

All replies

  • Your app may be vb6 but you still need to tell it to use the 1.1 version of the runtime.

    What you need to create is a vb6.exe.config file with the vb98 directory where the vb6.exe is located and tell it to use your 1.1 framework. something similar to the following. Hope this helps

    <configuration>

       <startup>
     <supportedRuntime version="v1.1.4322"/>
       </startup>

    </configuration>

    Friday, September 15, 2006 6:29 PM
  • Excellent! Just tried this and it worked. Unfortunately, the "mark as answer" function in this forum didn't! Really appreciate the help. I'm a little suprised that this information wasn't more easy to locate on the web. Perhaps it is and I just didn't look in the right place. Thanks again. //C
    Monday, September 18, 2006 6:22 AM
  •  norelc wrote:
    Excellent! Just tried this and it worked. Unfortunately, the "mark as answer" function in this forum didn't! Really appreciate the help. I'm a little suprised that this information wasn't more easy to locate on the web. Perhaps it is and I just didn't look in the right place. Thanks again. //C


    I'm having the same problem.  I'm calling a VB.NET 2003 dll that's registered in COM+.  I've added a reference to it in a VB6 DLL that I'm calling from a Classic ASP page.  Previously I was able to attach to my .NET dll and debug it.  I haven't been able to do this in a while and I'm thinking that it must be because I've installed VS 2005 on my machine subsequently.

    So in my C:\Program Files\Microsoft Visual Studio\VB98 directory I added a file called vb6.exe.config that contains the following:

    <configuration>

       <startup>
     <supportedRuntime version="v1.1.4322"/>
       </startup>

    </configuration>


    I also added an app.config file to my .NET dll's project that looks like:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <startup>
          <supportedRuntime version="v1.1.4322" />
       </startup>
    </configuration>

    So I'm running my VB6 dll in the IDE and I put a break point on the line after the CreateObject line in VB6 dll code.

        Dim objDotNet As MyDotNetDLL.clsMyDotNetClass
        Set objDotNet = CreateObject("MyDotNetDLL.clsMyDotNetClass")
        'Put a break point here...

    I have my VB.NET dll project open in the IDE and I try to attach to the process using Tools / Debug Processes.

    I pick dllhost that has "Microsoft Active Server pages" beside it with the Type Script, .NET, T-SQL, Win32.  I then pick "Common Language Runtime" as the program type that I want to debug and I still get the "Unable to attach to process" message.
    Wednesday, September 20, 2006 4:10 PM