Share via


The setup cannot run in compatibility mode

The Microsoft .Net Framework 4.5.2 Setup may fail with the below error message:

Capture

As per the install log:

Installation Blockers:
1.The setup cannot run in compatibility mode.
2.The .NET Framework 4.5.2 is not supported on this operating system.

I ran the process monitor tool and captured a trace for the Setup. As per the trace, I found that an OS app compat shim has been applied on the system.

=============================================================================================================

11:18:13.3061686 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegOpenKey HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\Setup.exe SUCCESS Desired Access: Read

11:18:13.3062049 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegSetInfoKey HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe SUCCESS KeySetInformationClass: KeySetHandleTagsInformation, Length: 0

11:18:13.3062285 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegQueryKey HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe SUCCESS Query: Full, SubKeys: 0, Values: 1

11:18:13.3062807 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegEnumValue HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe SUCCESS Index: 0, Name: {a266674f-8a16-4a84-97c9-088a46e530d7}.sdb, Type: REG_QWORD, Length: 8

11:18:13.3063232 PM NDP452-KB2901907-x86-x64-AllOS-ENU.exe 5296 RegCloseKey HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe SUCCESS

=============================================================================================================

A shim is a small library which transparently intercepts an API, changes the parameters passed, handles the operation itself, or redirects the operation elsewhere. Shims can also be used for running programs on different software platforms than they were developed for.  For more details: https://technet.microsoft.com/en-us/library/dd837644(v=ws.10).aspx 

I renamed registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Custom\setup.exe and started the NetFx 4.5.2 Setup package. It was successful and the issue was resolved. 

P.S. Creating an Application Compatibility Shim: https://blogs.technet.com/b/askperf/archive/2011/06/17/demystifying-shims-or-using-the-app-compat-toolkit-to-make-your-old-stuff-work-with-your-new-stuff.aspx 

ACT is the Application Compatibility Toolkit https://www.microsoft.com/downloads/details.aspx?familyid=24da89e9-b581-47b0-b45e-492dd6da2971&displaylang=en