Fixing Missing Windows App Runtime Environment Prompt for Unpackaged WinUI 3 Applications
This article will tell you how to fix the prompt for a missing Windows App Runtime environment 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 looks something like this:
This application requires the Windows App Runtime
Version 1.3
(MSIX package version >= 3000.882.2207.0)
Do you want to install a compatible Windows App Runtime now?

Clicking "Yes" will take you to the https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/downloads download page.
To fix this issue, you can download and install the Windows App Runtime installation package, WindowsAppRuntimeInstall.exe.
However, if an application requires users to install additional files like WindowsAppRuntimeInstall.exe, it is not ideal. This article will tell you how to make WinUI 3 applications work like traditional Win32 applications, where you can simply copy and run them on a user's machine.
Step 1: Make sure the Microsoft.WindowsAppSDK NuGet package is version 1.2 or higher. The latest version as of 2023.6.15 is 1.3.230602002. According to the official documentation, the WindowsAppSdkUndockedRegFreeWinRTInitialize feature was added in version 1.2. To avoid the prompt mentioned above, it is best to have the WindowsAppSdkUndockedRegFreeWinRTInitialize feature.
Step 2: Configure the csproj project file by setting WindowsAppSDKSelfContained to true and WindowsPackageType to None. By default, when WindowsAppSDKSelfContained is set to true and WindowsPackageType is set to None, WindowsAppSdkUndockedRegFreeWinRTInitialize is automatically configured to true in the SDK.
The modified csproj project file looks something 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>
<!-- The following two lines of code are the core -->
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<WindowsPackageType>None</WindowsPackageType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
</ItemGroup>
</Project>
After making the above modifications, you can independently publish the application without requiring users to install the Windows App Runtime environment. Simply double-click to run the application.
As there is currently a lack of official documentation on WindowsAppSdkUndockedRegFreeWinRTInitialize and UndockedRegFreeWinRT, I am not familiar with the details of this knowledge. If you are interested, please explore it on your own.
中文博客:WinUI 3 修复非打包应用运行提示缺少 Windows App Runtime 环境
Fixing Missing Windows App Runtime Environment Prompt for Unpackaged WinUI 3 Applications的更多相关文章
- windows如何解决Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
问题再现与解读 首次,使用 java 命令+任意参数 都会报这个错误,最典型的就是java -version 解读一下这个报错信息,注册表路径 Software\JavaSoft\Java Runti ...
- 不可或缺 Windows Native (25) - C++: windows app native, android app native, ios app native
[源码下载] 不可或缺 Windows Native (25) - C++: windows app native, android app native, ios app native 作者:web ...
- Eclipse中启动Tomcat报错:[There is insufficient memory for the Java Runtime Environment to continue.]的解决方案
1,报错截图 2,报错信息 五月 08, 2018 9:57:58 上午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [Se ...
- java:安装Runtime Environment,设置Tomcat Server 的方法
Eclipse 中开发Webapp, 一般需要配置Tomcat Server, 以便在Eclipse 中进行Debug.具体的步骤如下: 1. Windows ==>Preference ==& ...
- 使用 Portable Class Library(可移植类库)开发 Universal Windows App
今天在这里跟大家聊聊关于 Windows Universal 应用夸平台的问题,首先Universal Windows App的定义相信大家已经有所了解了(如果你是一个刚刚接触 Universal A ...
- A fatal error has been detected by the Java Runtime Environment(jdk 1.6的一个BUG)
几天做项目,生成一堆注解的实体,当实体数超过86个时,jvm报错: # # A fatal error has been detected by the Java Runtime Environmen ...
- 运行时环境(The Runtime Environment)
App Engine应用响应网络请求.当一个客户端(典型的是用户的Web浏览器)使用HTTP请求(比如获取在URL上的网页)连接上应用的时候,网络请求就开始了.当App Engine接收到请求时,它会 ...
- 安装J2EE的SDK报错:could not find the required version of the Java(TM)2 Runtime Environment in '(null)'的解决办法。
国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...
- java command line error opening registry key 'Software\JavaSoft\Java Runtime Environment' java.dll
C:\Users\huxxxxchan>javaError: opening registry key 'Software\JavaSoft\Java Runtime Environment'E ...
- java安装1.8的经验和Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVers问题处理
java安装1.8后的问题:之前安装了jdk1.7和jdk1.6,之后又安装jdk1.8,然后执行java -version,输出的是1.8的,后来在注册表把jdk1.8改为1.7,然 ...
随机推荐
- ArcMap的mxd文件没有数据、显示感叹号怎么办?
本文介绍在ArcMap软件中,导入.mxd地图文档文件后图层出现感叹号.地图显示空白等情况的解决办法. 在ArcMap软件使用过程中,我们经常会需要将包含有多个图层的.mxd地图文档文件导入软 ...
- Liunx-LVM创建与扩容
LVM是 Logical Volume Manager(逻辑卷管理)的简写,它是Linux环境下对磁盘分区进行管理的一种机制,它由Heinz Mauelshagen在Linux 2.4内核上实现,最新 ...
- vscode插件设置——Golang开发环境配置
适用读者: Go初学者, 到这里, 你应该是处于已经完成了 go 的安装之后, 准备写个 "Hello Gopher" 之前. 本篇力求给初学者-未来的Gopher 们 一个正确的 ...
- 【OpenCV】OpenCV (C++) 与 OpenCvSharp (C#) 之间数据通信
OpenCV是一个基于Apache2.0许可(开源)发行的跨平台计算机视觉和机器学习软件库,可以运行在Linux.Windows.Android和Mac OS操作系统上. 它轻量级而且高效--由一 ...
- KingbaseES 的oracle兼容性参数
KingbaseES用户可通过设置相关的数据库兼容参数,部分或全部启用Oracle兼容特性. 常用的兼容性参数有以下这些: 参数名称 参数说明 ora_forbid_func_polymorphism ...
- KingbaseES V8R6 集群运维案例 -- 禁止普通用户su到root
案例说明: 在集群管理中,会使用到root权限(如ip.aring命令等),为安全需要,有的生产环境禁止普通用户su切换到root,本案例测试了禁止普通用户su切换到root对集群管理带来的影响. 集 ...
- 【Java】多线程之实现Runnable接口
1 /** 2 * 3 */ 4 package com.raliable.chapter_0; 5 /** 6 * @author : Administrator 7 * @date :2022年4 ...
- Python爬虫爬取京东某商品评论信息存入mysql数据库
1 """ 2 https://club.jd.com/comment/productPageComments.action?callback=fetchJSON_com ...
- net.sf.json.JSONObject,将MySQL数据库的数据读出转化为json数据
maven依赖: 1 <dependency> 2 <groupId>net.sf.json-lib</groupId> 3 <artifactId>j ...
- Jetty的threadpool模块
Jetty提供的线程池相关的模块,如下: threadpool threadpool-virtual,使用JDK 21提供的virtual threads. threadpool-virtual-pr ...