FIX: Unmanaged debugging not possible until you install Visual C++ .NET (813134)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Visual Basic .NET (2002)
  • Microsoft Visual C# .NET (2002)
  • Microsoft Visual J# .NET (2002)

SYMPTOMS

You may not be able to debug projects that refer unmanaged DLLs. When you try to debug, you may receive the following error message:
Error while trying to run project. Unable to start debugging.
Unable to start program <name>.
Unmanaged debugging is not available.

Where name is the name of your executable file and the full path of the file.

CAUSE

Microsoft Visual Studio .NET 2002 installs the unmanaged debugger only with Visual C++ .NET.

RESOLUTION

Use Add Remove Programs to add the Visual C++ .NET feature to the following products.
  • Visual Studio .NET 2002, Professional Edition
  • Visual Studio .NET 2002, Enterprise Architect Edition
  • Visual Studio .NET 2002, Enterprise Developer Edition
  • Visual Studio .NET 2002, Academic Edition

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

Install Visual Studio .NET 2002. During the setup process, under Language Tools, click to clear Visual C++ .NET so that Visual C++ .NET is not installed.

Steps to Create an Unmanaged DLL:

  1. In Visual Basic 6.0, create a new ActiveX DLL project. By default, Class1 is created.
  2. Change the name of the Class1 module to MyClass.
  3. On the Project menu, click Project1 Properties.
  4. Name the project MyUnmanagedDll.
  5. Paste the following code in the MyClass module:
    Public Function GetHelloString() as String
        GetHelloString = "Hello from Unmanaged Code"
    End Function
  6. Save the MyUnmanagedDll project.
  7. To create MyUnmanagedDll.Dll, click File, and then click Make MyUnmanagedDll.Dll .

Steps to Refer an Unmanaged DLL from Managed Code:

  1. In Visual Studio .NET 2002, create a new Visual Basic .NET Console Application project, and name the project MySampleApplication.
  2. In Solution Explorer, right-click Reference, and then click Add Reference.
  3. Click the COM tab.
  4. Under Component Name, click to select MyUnmanagedDll, and then click OK.
  5. Paste the following code in Main sub:
    Sub Main()
        Dim myFunction as MyUnmanagedDll.MyClassClass
        myFunction = New MyUnmanagedDll.MyClassClass()
       Console.WriteLine (myFunction.GetHelloString())
    End Sub
  6. Insert a break point on the following line of code:
    Console.WriteLine (myFunction.GetHelloString())
  7. In Solution Explorer, right-click MySampleApplication, and then click Properties.
  8. In the Properties dialog box, click Debugging, and then click to select Unmanaged code debugging.
  9. Press F5 to debug the application. You receive the error message that is described in the "Symptoms" section of this article.

Secure Data

Content Maintenance:3057

Modification Type:MajorLast Reviewed:7/29/2005
Keywords:kbvs2002sp1sweep kbBug KB813134 kbAudDeveloper