无法加载类型; process_dpi_awareness'从汇编' windowsbase,版本= 4.0.0.0,

发布于 2025-02-03 08:25:06 字数 793 浏览 5 评论 0原文

我已经使用此清单文件添加了该应用程序的DPI意识:

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

它主要工作,但是在客户端机器之一上抛出了:

Could not load type 'PROCESS_DPI_AWARENESS' from assembly 'WindowsBase, Version=4.0.0.0, 

在我的代码process_dpi_awareness中未使用变量。 System.WindowsBase被添加为我的项目的依赖。

我使用以下几个窗口在几个窗口上使用DPI:

 var dpi = VisualTreeHelper.GetDpi(this);

您可以暗示如何解决此问题吗?

I have added DPI awareness for the app using this manifest file:

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

It works mostly but on one of the client machines exception is thrown:

Could not load type 'PROCESS_DPI_AWARENESS' from assembly 'WindowsBase, Version=4.0.0.0, 

In my code PROCESS_DPI_AWARENESS variable is not used. System.WindowsBase is added as dependancy to my project.

I use DPI on several windows using this:

 var dpi = VisualTreeHelper.GetDpi(this);

Could you hint how to resolve this issue ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文