3

In the ValidationResult that I get when readying my app for submission to the Microsoft Store (which my app "PASSED WITH WARNINGS") , I got this "Warning" under the "High-DPI support" section of the report:

enter image description here

I definitely do not want users to experience incorrect scaling of UI elements, clipped text, or blurry images, so I want to declare my app as DPI-aware in the app manifest. But just where and how?

I found this, and the entry apparently should be something like this:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
  <asmv3:application>
    <asmv3:windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>

Most particularly (I reckon) this line is the key one:

<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>

...but I don't see just how I should add that (if it a semi-automated process), or which file to add it to. I searched for "<assembly xmlns" but nothing was found.

I don't want to "wing it" and break something, or make matters worse, so I'd like to know just how to add this DPI-awareness to my app. My solution has a Package.appxmanifest file, but it opens as a GUI set of tabs (on none of which I see anything about DPI), and Package.StoreAssociation.xml, but I don't know where in that I should put such a DPI-Awareness declaration (if that's even the appropriate file to which to add it).

UPDATE

So I now have this:

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
    </windowsSettings>
  </application>

...in the app.manifest file of the main project (not the package project), but I still get that same warning.

UPDATE 2

Based on the comment and references provided by CoCalceDew, I changed my manifest to this:

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <!--<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitor/dpiAwareness>-->
      <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor, System</dpiAwareness>
      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
    </windowsSettings>
  </application>

...but have to wait until my project compiles again (see this for what the problem is) before seeing if it does the trick.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862

0 Answers0