I have some Windows Forms applications that need to run on XP/2003/Vista/7/2008/8/2012, and should still look good when the user chooses Large Fonts or a higher DPI. Enabling DPI awareness in the app.manifest works well for Vista and later, but on XP/2003 the application reports an error due to an unsupported manifest entry.
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<asmv1:application>
<asmv1:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv1:windowsSettings>
</asmv1:application>
</asmv1:assembly>
Running the app with that manifest on Windows 2003 causes this error message:
This application has failed to start because the application
configuration is incorrect.
And this Windows event message is logged:
The element asmv1:application appears as a child of element
urn:schemas-microsoft-com:asm.v1^assembly which is not supported
by this version of Windows.
Is it possible to declare the manifest in a way that allows XP/2003 to ignore this portion of the manifest that they do not support? Or must I remove the manifest and make conditional calls to SetProcessDPIAware (even though everything I've read recommends against using that API function)?
<dpiAware>true</dpiAware>
in the manifest file for one of my applications, and it runs fine all the way back on Windows 2000. Granted, this is a native C++ app, not .NET WinForms, so I suppose it is the .NET Framework that is reading the manifest file information and throwing the error. (I haven't checked to Windows event log to see if something is logged. It might be. I don't really care too much about that; the app runs file.) - Cody Gray