Windows App Certification Kit: DPI-Awareness Validation

Recently, I was working on a new app to publish in the Windows Store (Lua Automation IDE) and I received the following error despite having per monitor DPI specified in the app.manifest file (as a side note, publishing traditional desktop apps to Microsoft is finally very easy).

Warning: The DPI-awareness validation test detected following Warnings:
File LuaAutomation.IDE\LuaAutomation.IDE.exe neither has PerMonitorV2 manifested in the manifest nor calls into DPI Awareness APIs for ex: user32!SetProcessDpiAwarenessContext or user32!SetThreadDpiAwarenessContext.
The app 9b392703-f2cd-4226-9aae-b2a827f6eff3_2022.7.1.0_neutral__622pp7g9gfywj is not DPI Aware.
Impact if not fixed: Apps that are not DPI-aware but are running on a high-DPI display setting can exhibit incorrect scaling of UI elements, clipped text, and blurry images.
How to fix: It is recommended that you declare your app as DPI-aware in the app manifest. Otherwise, app should use DPI Awareness API calls for example:either SetProcessDpiAwarenessContext or SetThreadDpiAwarenessContext APIs.
Writing High-DPI Apps

My mistake was that although I included an app.manifest in the project I did not specify it's location in the csproj file. Note the ApplicationManifest entry in the blow snippet.


	For full inclusion, here is a copy of the `app.manifest` file I'm using (this is a WPF app targeting .NET Core that will be published to the Microsoft Store).
	``` xml
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
	<assemblyIdentity version="" name=""/>
	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
			<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
				<requestedExecutionLevel level="asInvoker" uiAccess="false" />

	<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
			<!-- Windows 10 and 11 -->
			<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />


	<application xmlns="urn:schemas-microsoft-com:asm.v3">
			<dpiAware xmlns="">true</dpiAware>
			<dpiAwareness xmlns="">PerMonitorV2</dpiAwareness>
			<longPathAware xmlns="">true</longPathAware>


Leave a comment

Please note that we won't show your email to others, or use it for sending unwanted emails. We will only use it to render your Gravatar image and to validate you as a real person.