Microsoft KB Archive/813134

= FIX: Unmanaged debugging not possible until you install Visual C++ .NET =

Article ID: 813134

Article Last Modified on 7/29/2005

-

APPLIES TO


 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition
 * Microsoft Visual C# .NET 2002 Standard Edition
 * Microsoft Visual J# .NET 2003 Standard Edition

-



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 .

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.



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:
 In Visual Basic 6.0, create a new ActiveX DLL project. By default, Class1 is created. Change the name of the Class1 module to MyClass . On the Project menu, click Project1 Properties. Name the project MyUnmanagedDll .  Paste the following code in the MyClass module: Public Function GetHelloString as String GetHelloString = &quot;Hello from Unmanaged Code&quot; End Function </li> Save the MyUnmanagedDll project.</li> To create MyUnmanagedDll.Dll, click File, and then click Make MyUnmanagedDll.Dll .</li></ol>

Steps to Refer an Unmanaged DLL from Managed Code:
<ol> In Visual Studio .NET 2002, create a new Visual Basic .NET Console Application project, and name the project MySampleApplication .</li> In Solution Explorer, right-click Reference, and then click Add Reference.</li> Click the COM tab.</li> Under Component Name, click to select MyUnmanagedDll, and then click OK.</li>  Paste the following code in Main sub: Sub Main Dim myFunction as MyUnmanagedDll.MyClassClass myFunction = New MyUnmanagedDll.MyClassClass Console.WriteLine (myFunction.GetHelloString) End Sub </li>  Insert a break point on the following line of code: Console.WriteLine (myFunction.GetHelloString) </li> In Solution Explorer, right-click MySampleApplication, and then click Properties.</li> In the Properties dialog box, click Debugging, and then click to select Unmanaged code debugging.</li> Press F5 to debug the application. You receive the error message that is described in the &quot;Symptoms&quot; section of this article.</li></ol>

<div class="securedata_section">

Secure Data
Keywords: kbbug kbvs2002sp1sweep KB813134

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.