'VS2019 Windows 10 C++ exe compatibility tool wants to run as Windows 8
I am using VS2019 (16.11.10) and have created a C++ exe using Windows SDK 10.0.19041.0. When I look at the properties of the exe in Windows 10 the compatibility tab appears and the troubleshooter wants to run the exe in Windows 8 compatibility mode.
I have added information to the embedded manifest using assembly identity:
MyCompany.MyGroup.MyApp, processorArchitecture=IA64, version=2.0.22.1, type=win32, language=neutral
and also an extra manifest file containing...
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<maxversiontested Id="10.0.19041.0"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<!-- Windows 10 -->
Can anyone please tell me how to find out why Windows 10 wants to run this exe in Windows 8 compatibility mode, when it runs OK as a Windows 10 exe. Many thanks.
I have tried checking the embedded manifest by opening the exe in VS2019 to verify that the information I have added actually appears, it does. I have tried making the manifest file not embedded, this makes no difference.
Solution 1:[1]
I suspect your 'snippet' isn't passing the schema validation. Try:
- Add a
settings.manifestto your project that contains:
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 / Windows 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>
(once you have it working, feel free to trim it down)
- Make sure in your project properties you have Linker -> Manifest File -> Generate Manifest set to "Yes"
(this page should be defaulted to run "asInvoker". If you need admin rights, you'd change it here).
- In the project properties, also make sure Manifest Tool -> Input and Output -> Embed Manifest is set to "Yes".
(this is also where you'd set DPI awareness if desired)
See this blog post
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Chuck Walbourn |
