0 out of 3 rated this helpful - Rate this topic

Declaring Managed Applications As DPI-Aware

To declare your managed application as DPI-aware in Microsoft Visual Studio 2008, do the following:

  1. In the Solution Explorer, right-click on your project (suppose your project is named DPIAware), point to Add, and then click New Item.

  2. In the Add New Item – DPIAware dialog box, select Application Manifest File, and then click Add. The app.manifest file appears.

    Screen shot showing the Add New Item dialog box.

  3. Copy and paste the following text into the app.manifest file and then save.

    
    <?xml version="1.0" encoding="utf-8"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
      <asmv3:application>
        <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
          <dpiAware>true</dpiAware>
        </asmv3:windowsSettings>
      </asmv3:application>
    </assembly>
    		
    
  4. In the Solution Explorer, right-click on the DPIAware project, and then click Properties to verify that the app.manifest is used.

    Screen shot showing the Application settings.

  5. Your application is now DPI-aware.

For information on how to make your Win32 applications DPI-aware, see Writing High-DPI Win32 Applications.

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
SetProcessDPIAware
I use SetProcessDPIAware for clickonce (not using  the manifest file ). It works.
SetProcessDPIAware
I use SetProcessDPIAware for clickonce. It works.
It works but them the ClickOnce doesn't work
For me it does work but there's another issue which drives me mad.

Installing ClickOnce published applications is not possible if there is the tag in the manifest file about the dpi-awareness. I've checked this in visual studio 2010 many times. If there's a tag <asmv3:windowsettings> in the manifest file then the published application fails to install. It's enough to comment-out this whole tag before publishing and application installs fine.

I wonder if it has something to do with the url in the xmlns attribute. Typing this url in the web browser returns an error.
Not working
in a VS2008 C# WindowsForms project.