this article will guide you on how to resolve the issue of a missing windows app runtime environment prompt when running non-packaged winui 3 applications on a customer’s machine.
The prompt for a missing Windows App Runtime environment on the user’s machine appears as follows:
By clicking “Yes,” you will be directed to the download page at https://www.php.cn/link/460eb45f1f9b67a58c96a73be551f37b.
To resolve this issue, you can download and install the Windows App Runtime installation package, known as WindowsAppRuntimeInstall.exe.
However, requiring users to install additional files like WindowsAppRuntimeInstall.exe is not ideal for an application. This article will explain how to configure WinUI 3 applications to function like traditional Win32 applications, allowing them to be simply copied and run on a user’s machine.
Step 1: Ensure that the Microsoft.WindowsAppSDK NuGet package is at version 1.2 or later. As of June 15, 2023, the latest version available is 1.3.230602002. The WindowsAppSdkUndockedRegFreeWinRTInitialize feature, which helps avoid the aforementioned prompt, was introduced in version 1.2.
DeepSeek App
DeepSeek官方推出的AI对话助手App
78 查看详情
Step 2: Modify the csproj project file by setting WindowsAppSDKSelfContained to true and WindowsPackageType to None. When these settings are configured as such, the SDK automatically sets WindowsAppSdkUndockedRegFreeWinRTInitialize to true.
The updated csproj project file would look like this:
WinExe net6.0-windows10.0.19041 enable true x86;x64;x86 win10-x86;win10-x64 true None
After applying these modifications, you can publish the application independently, eliminating the need for users to install the Windows App Runtime environment. The application can be run by simply double-clicking it.
Due to the limited official documentation available on WindowsAppSdkUndockedRegFreeWinRTInitialize and UndockedRegFreeWinRT, I am not well-versed in their specifics. If you’re interested in learning more, I recommend further exploration on your own.
以上就是Fixing Missing Windows App Runtime Environment Prompt for Unpackaged WinUI 3 Applications的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/617178.html
微信扫一扫
支付宝扫一扫