-
Oct 27th, 2017, 02:20 AM
#1
Thread Starter
New Member
Application is Improperly Formatted - DPI Aware/Manifest Error
Hi there,
I am on VB .Net 2017 with .Net 4.6.2.
I wrote a relatively straight forward application that incorporates the need for taking a full screen screenshot. The screen resolution it was pulling was not accurate, and I discovered that I need to make my application DPI Aware in order for my screenshot to get the right resolution to take a screenshot of the entire screen.
I added an app.manifest to the project, and uncommented this section:
Code:
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
Doing so corrected the screen resolution issue I was having and my application works perfectly. However, now when I Publish my application, the setup program pops up a window stating "Cannot continue. The application is improperly formatted. Contact the application vendor for assistance."
If I re-comment that section from the app.manifest, then everything is fine, except the resolution is still incorrect. So the app.manifest existing in itself doesn't appear to be an issue. It is specifically uncommenting that particular section that is causing problems.
I'm at a loss. This is my first VB project since VB6 was all the rage god knows how long ago, so I don't really have the know-how to troubleshoot this myself.
I found a post somewhere on Google in which someone suggests declaring the DPI Awareness through code rather than manifest, and they give a half-example of "something like this," without completing the code nor explaining where/how to use it.
Any ideas how I can get around this issue?
Thank you so much!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|