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



The information in this article 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 Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • 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 Windows XP Professional
  • Microsoft Windows 2000 Professional

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 1mscorlib.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 2mscorlib.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

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

      Note In Visual Studio 2005, click Visual C++.
    3. Under Templates, click Windows Forms Application (.NET).

      Note In Visual Studio 2005, click Windows Forms Application.
    4. In the Name box, type MyApp, and then click OK.
    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.
  5. On the Debug menu, click Start Without Debugging.
  6. To attach the Command Language Runtime process and the Native process to Visual Studio .Net, follow these steps:
    1. On the Debug menu, click Processes. The Processes dialog box appears.
    2. Click Attach. The Attach to Processes dialog box appears.
    3. 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.
    4. Click Close.
  7. 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 "Symptoms" section.
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

REFERENCES

For more information, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:3/6/2006
Keywords:kbvs2005swept kbvs2005applies kbNativeAttributes kbUpgrade kbDLL kbprb KB837224 kbAudDeveloper