Microsoft KB Archive/837224

= Native Image Generator DLLs are not loaded for your Visual Studio .NET application project when you upgrade from Windows 2000 to Windows XP =

Article ID: 837224

Article Last Modified on 5/11/2007

-

APPLIES TO


 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * 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 Windows XP Professional
 * Microsoft Windows 2000 Professional Edition

-





SYMPTOMS
You upgrade the operating system on your computer from Microsoft Windows 2000 Professional to Windows XP Professional, and then you create an application project on your computer by using Microsoft Visual Studio .NET or Microsoft Visual Studio 2005. When you build and then run the application project, the Native Image Generator (Ngen.exe) DLLs are not loaded.

You notice that only one Mscorlib.dll file is loaded. When this behavior occurs, an entry that is similar to the following appears in the Modules debugger window:

mscorlib.dll 79780000-79980000 C:\WINNT\Microsoft\Framework\v1.1.4322\mscorlib.dll 16 1.01.4322.573 [1904] MyApp.exe: Native 2/20/2004 3:47 PM No symbols loaded



RESOLUTION
To resolve this problem, regenerate the Ngen image by running the Ngen.exe file on the assembly. In this case, the assembly is Mscorlib.dll.



MORE INFORMATION
The expected behavior is that two Mscorlib.dll files should be loaded. The entries that appear for these are similar to following:

Entry 1

mscorlib.dll 79780000-79980000 C:\WINNT\Microsoft\Framework\v1.1.4322\mscorlib.dll 16 1.01.4322.573 [1904] MyApp.exe: Native 2/20/2004 3:47 PM No symbols loaded

Entry 2

mscorlib.dll 79780000-7ACI8000 C:\WINDOWS\assembly\NativeImages1_v1.1.4322\mscorlib\1.0.5000.0_b77a5c561934e089_e2f6942\mscorlib.dll 17 [1904] MyApp.exe: Native 2/20/2004 3:47 PM No symbols loaded.

Steps to reproduce the behavior
 Install Microsoft Visual Studio .NET or Microsoft Visual Studio 2005. Upgrade the operating system from Windows 2000 Professional to Windows XP Professional. Start Microsoft Visual Studio .NET or Microsoft Visual Studio 2005. Create a Microsoft Visual C++ project. To do this, follow these steps:  On the File menu, point to New, and then click Project. The New Project dialog box appears. Under Project Types, click Visual C++ Projects.

Note In Visual Studio 2005, click Visual C++.</li> Under Templates, click Windows Forms Application (.NET).

Note In Visual Studio 2005, click Windows Forms Application.</li> In the Name box, type MyApp, and then click OK.</li></ol>

Note The Windows Forms Application (.NET) template is not available in Visual Studio .NET 2002. If you are using Visual Studio .NET 2002, select the Managed C++ Application template, and then write the code explicitly for the user interface.</li> On the Debug menu, click Start Without Debugging.</li> To attach the Command Language Runtime process and the Native process to Visual Studio .Net, follow these steps: <ol style="list-style-type: lower-alpha;"> On the Debug menu, click Processes. The Processes dialog box appears.</li> Click Attach. The Attach to Processes dialog box appears.</li> Under Choose the program types that you want to debug, select the Common Language Runtime check box and the Native check box, and then click OK.</li> Click Close.</li></ol> </li> On the Debug menu, point to Windows, and then click Modules. The Modules window appears. In the Modules window, notice the behavior that is mentioned in the &quot;Symptoms&quot; section.</li></ol>

Note You can use the ngen/show command to determine if Mscorlib.dll exists in the native image cache. If Mscorlib.dll does not exist in the native image cache, run the following command to regenerate it:

ngen Mscorlib.dll

<div class="references_section">