When log into my Windows Server 2008 R2 I get an error

oobe.exe - .NET framework Initialization Error.

Unable to find a version of the runtime to run this application.

What is the cause of this error and how to fix it?


I think that this error emerged after I changed COMPLUS_ENABLE_64bit flag. It might have something to do this that?

  • What version of the CLR was the application built on, and what CLR versions do you have on the machine? – Greg Askew Mar 14 '13 at 12:00
  • I find these versions: v2.0.50727, v3.0, v3.5, v4, v4.0 from Computer\HKEY_LOCAL_MACHINE\SOFTWARE|MICROSOFT\NET FRAMEWORK SETUP\NDP – jrara Mar 14 '13 at 12:10
  • Application should run with v2.0.50727 .Net framework – jrara Mar 14 '13 at 12:10

The executable may be compiled with flags indicating it may only run in a certain "bitness". You can change these flags using the coreflags.exe utility that is available in every .Net SDK.

The sdk for .net 2.0 can be found here.

There are 3 mainstream modes to configure a DLL or executable:

  • AnyCPU (will jit to whatever is available, preferring 64bit): /32BIT+ /ILONLY+
  • x86: (disables 64bit compilation) /32BIT+ /ILONLY-
  • x64: (disables 32bit compilation) /32BIT- /ILONLY-

Usually AnyCPU is the best choice, unless you are doing COM interop or in another way calling native code, in which case the bitness should be the same as what the native code has been compiled for.

Probably you should not try changing the bitness of a 3rd party DLL, since if it isn't the default "AnyCPU", there probably is a good reason (usually native satellite DLL's that may do anything, for example generate PDF files or use other native 3rd party libraries).

Edit: Following IBM's advice to disable the 64bit runtime is quite an overkill, you can do the same for only this application by using the coreflags utiluity while leaving the rest of the framework and all depending applications intact. Revert the change by running:

C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Ldr64.exe Set64
| improve this answer | |
  • Running Ldr64.exe Set64 solved the problem, many thanks! – jrara Mar 20 '13 at 10:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.