NGen cannot proceed because Mscorlib.dll does not have a native image

0

In the Application event log I see hundreds of error messages like the one below:

.NET Runtime Optimization Service (clr_optimization_v4.0.30319_32) - 1>Failed to compile: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 . Error code = 0x80131f06, Event id = 1101

In the ngen.log (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319) I see errors like the following:

Error compiling System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089: NGen cannot proceed because Mscorlib.dll does not have a native image (Exception from HRESULT: 0x80131F06)

I also get a similar error message if I run the following command at the command prompt:

ngen install system.dll

I managed to pinpoint the reason why the error is thrown: it is because there is invalid information stored at the following registry keys:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion\NativeImagesIndex\v4.0.30319_32\index17c]:

NIUsageMask and ILUsageMask

I could reproduce the error on another machine by deleting the index17c.dat file located at C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319. The file is hidden, empty, and its name dictates the registry path mentioned above.

My question is: What could be the root cause for this? (Someone manually altering the values in the registry is out of the question)

.net
ngen
asked on Stack Overflow Feb 19, 2013 by Stancu Mihai • edited Feb 19, 2013 by Azik Abdullah

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0