Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

EDIT:

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

share|improve this question
    
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

1 Answer 1

up vote 1 down vote accepted
+50

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
share|improve this answer
    
Running Ldr64.exe Set64 solved the problem, many thanks! –  jrara Mar 20 '13 at 10:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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