博文

目前显示的是标签为“UAP”的博文

【UAP】使用 .NET Core App 编写 UAP

图片
众所周知,2024年9月微软正式宣布了 .NET Core App 的 UWP 支持,至此我们终于可以在新版 csproj 用 .NET 8 及以上编写 UWP 了,那么我们可不可以通过修改清单的方式来让 UWP 变成 UAP 呢? UWP 和 UAP 使用的是同一套 WinRT API ,Windows 区分 UAP 和 UWP 的方式是看清单,只要是用 UAP 的清单就会仿真成 Win8.1 模式,于是我们只需要将清单变成 UAP 的样子就行了。所以首先我们新建一个 .NET 9 Native AOT 的 UWP 项目 然后我们修改清单,Win8 App 清单如下,内容按需填写,Win8.1 App 的清单可以通过在 Github 搜索 OSMaxVersionTested language:XML 找到, 6.2 是 Win8, 6.3 是 Win8.1 ( $targetentrypoint$ 需配合 ApplicationEntryPoint 使用) <?xml version= "1.0" encoding= "utf-8" ?> < Package xmlns = "http://schemas.microsoft.com/appx/2010/manifest" > < Identity Name = "wherewhere.CoreAppUAP" Publisher = "CN=where" Version = "0.0.1.0" /> < Properties > < DisplayName > CoreAppUAP </ DisplayName > < PublisherDisplayName > wherewhere </ PublisherDisplayName > < Logo > Assets\StoreLogo.png </ Logo > ...