NGen error failed to load runtime error

0

I came across a strange error when using NGen from .NET Framework 4 to compile a bunch of DLL assemblies. The install worked for some of the DLLs, but for some others it produced the following error message:

Failed to load the runtime. (Exception from HRESULT: 0x80131700). Assembly AseemblyFileLocation requires version v4.0.30319 of the runtime to run. Assembly will be compiled once the correct runtime is installed.

I am certain that I have the correct runtime version. I found that no one had come across this when I tried a search on web for answers, which is even stranger.

Any leads on this? Thanks.

.net
dll
assemblies
ngen
asked on Stack Overflow Oct 25, 2011 by shiufai • edited Oct 27, 2011 by starblue

1 Answer

1

I ran into this issue as well and it turned out the culprit was the following entry in the assembly .config file:

<startup>
  <supportedRuntime version="v3.5"/>
</startup>

Once I removed it, Ngen ran fine.

answered on Stack Overflow Nov 2, 2011 by BWalter

User contributions licensed under CC BY-SA 3.0