修复WinUI3应用缺失WindowsApp运行时环境提示
本文详细介绍了如何解决在客户机器上运行非打包的WinUI 3应用程序时,缺少Windows App运行时环境提示的问题。通过确保使用Microsoft.WindowsAppSDK NuGet包的最新版本,并修改csproj项目文件中的特定设置,可以使WinUI 3应用程序像传统的Win32应用程序一样运行,无需用户额外安装Windows App运行时环境。文章提供了具体的步骤和配置示例,帮助开发者轻松实现这一目标。
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://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/downloads.
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.
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:
<project sdk="Microsoft.NET.Sdk"> <propertygroup> <outputtype>WinExe</outputtype> <targetframework>net6.0-windows10.0.19041</targetframework> <nullable>enable</nullable> <usewinui>true</usewinui> <platforms>x86;x64;x86</platforms> <runtimeidentifiers>win10-x86;win10-x64</runtimeidentifiers> <windowsappsdkselfcontained>true</windowsappsdkselfcontained> <windowspackagetype>None</windowspackagetype> </propertygroup> <itemgroup> <packagereference include="Microsoft.WindowsAppSDK" version="1.3.230602002"></packagereference> <packagereference include="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.756"></packagereference> </itemgroup> </project>
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.
终于介绍完啦!小伙伴们,这篇关于《修复WinUI3应用缺失WindowsApp运行时环境提示》的介绍应该让你收获多多了吧!欢迎大家收藏或分享给更多需要学习的朋友吧~golang学习网公众号也会发布文章相关知识,快来关注吧!

- 上一篇
- 免编程开发app新模式,节省成本高达90%

- 下一篇
- 生鲜app优势及买菜app开发成本揭秘
-
- 文章 · 软件教程 | 3小时前 |
- 电脑进系统黑屏怎么解决
- 438浏览 收藏
-
- 文章 · 软件教程 | 4小时前 |
- 电脑黑屏只有鼠标怎么处理
- 410浏览 收藏
-
- 文章 · 软件教程 | 4小时前 |
- Win11怎么找回我的电脑图标教程
- 240浏览 收藏
-
- 文章 · 软件教程 | 4小时前 |
- Win7截图快捷键大全
- 258浏览 收藏
-
- 文章 · 软件教程 | 4小时前 |
- 电脑黑屏主机运行,屏幕无显示怎么解决
- 156浏览 收藏
-
- 文章 · 软件教程 | 5小时前 |
- 蓝屏0x000000f4解决方法与修复教程
- 498浏览 收藏
-
- 文章 · 软件教程 | 5小时前 |
- Win10玩红警打不开?兼容性设置教程
- 132浏览 收藏
-
- 文章 · 软件教程 | 5小时前 |
- Win10取消开机密码步骤详解
- 370浏览 收藏
-
- 文章 · 软件教程 | 5小时前 |
- 电脑启动卡住无法进入系统解决方法
- 294浏览 收藏
-
- 文章 · 软件教程 | 5小时前 |
- 笔记本无法开机?故障排查全攻略
- 227浏览 收藏
-
- 文章 · 软件教程 | 6小时前 |
- Win8.1进入恢复模式方法详解
- 348浏览 收藏
-
- 文章 · 软件教程 | 6小时前 |
- 装系统步骤,小编教你电脑怎么装xp系统
- 119浏览 收藏
-
- 前端进阶之JavaScript设计模式
- 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
- 542次学习
-
- GO语言核心编程课程
- 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
- 508次学习
-
- 简单聊聊mysql8与网络通信
- 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
- 497次学习
-
- JavaScript正则表达式基础与实战
- 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
- 487次学习
-
- 从零制作响应式网站—Grid布局
- 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
- 484次学习
-
- 边界AI平台
- 探索AI边界平台,领先的智能AI对话、写作与画图生成工具。高效便捷,满足多样化需求。立即体验!
- 14次使用
-
- 免费AI认证证书
- 科大讯飞AI大学堂推出免费大模型工程师认证,助力您掌握AI技能,提升职场竞争力。体系化学习,实战项目,权威认证,助您成为企业级大模型应用人才。
- 39次使用
-
- 茅茅虫AIGC检测
- 茅茅虫AIGC检测,湖南茅茅虫科技有限公司倾力打造,运用NLP技术精准识别AI生成文本,提供论文、专著等学术文本的AIGC检测服务。支持多种格式,生成可视化报告,保障您的学术诚信和内容质量。
- 163次使用
-
- 赛林匹克平台(Challympics)
- 探索赛林匹克平台Challympics,一个聚焦人工智能、算力算法、量子计算等前沿技术的赛事聚合平台。连接产学研用,助力科技创新与产业升级。
- 240次使用
-
- 笔格AIPPT
- SEO 笔格AIPPT是135编辑器推出的AI智能PPT制作平台,依托DeepSeek大模型,实现智能大纲生成、一键PPT生成、AI文字优化、图像生成等功能。免费试用,提升PPT制作效率,适用于商务演示、教育培训等多种场景。
- 183次使用
-
- pe系统下载好如何重装的具体教程
- 2023-05-01 501浏览
-
- qq游戏大厅怎么开启蓝钻提醒功能-qq游戏大厅开启蓝钻提醒功能教程
- 2023-04-29 501浏览
-
- 吉吉影音怎样播放网络视频 吉吉影音播放网络视频的操作步骤
- 2023-04-09 501浏览
-
- 腾讯会议怎么使用电脑音频 腾讯会议播放电脑音频的方法
- 2023-04-04 501浏览
-
- PPT制作图片滚动效果的简单方法
- 2023-04-26 501浏览