Archive for June, 2012

Microsoft .NET Framework 4 fails to install due to “The setup cannot run in compatibility mode” error.

2012-06-25 14 comments

I was having this issue trying to install the full version of .NET v4.0 on Windows 2008R2. No matter what I tried: changing compatibility modes, running as administrator – I’ve got “The setup cannot run in compatibility mode” error. I received the message whether I tried to install OR uninstall it (Using add/remove programs).

Here is how you could resolve this issue:
1. Download the full installer (dotNetFx40_Full_x86_x64.exe) from here Microsoft site.
2. Extract it into a new folder using WinRAR or 7-Zip, for example “c:\downloads\dotNetFx40_Full_x86_x64\”.
3. Once extracted, you need to edit 3 files, all “ParameterInfo.xml”. Following from the example folder in step two, the three files are located:


EDIT ALL three files, do NOT edit one and copy it to the other folders – they are different and this won’t work. In each file, you’re looking for a block of code that looks like this:

<BlockIf DisplayText="#(loc.Blocker_in_OS_Compatibility_Mode)" ID="AppCompatMode">
<IsInOSCompatibilityMode />

Remove these these 5 lines from each file to disable the compatibility mode check. Remember to save.

4. Once that is done, open a DOS prompt in Administrator Mode and run the setup utility located in the “dotNetFx40_Full_x86_x64” folder created above. You need to tell it what architecture you’re on. If you’re running 32-bit Windows, use:

setup /x86

If you’re using 64-bit windows, use:

setup /x64

It should bring up the installer and continue normally without receiving the compatibility mode error. I suspect other installers suffering from this error might be able to be modified in a similar way.