简体   繁体   English

是否可以将未打包的 Windows 应用程序 SDK (WinUI 3) 作为独立的单个文件发布?

[英]Is it possible to publish an unpackaged Windows App SDK (WinUI 3) as self contained single file?

I'm pretty sure I have all the right flags and everything set according to Microsoft Docs, however the UI dlls are not being included in the single file exe.我很确定我根据 Microsoft Docs 设置了所有正确的标志和所有内容,但是 UI dll 不包含在单个文件 exe 中。

AFAIK, you can't. AFAIK,你不能。 Self-Contained does not mean One-Single-File .自包含并不意味着One-Single-File It means that all the dependencies will be next to your EXE so you won't need to install runtimes to the target device.这意味着所有依赖项都将在您的 EXE 旁边,因此您无需将运行时安装到目标设备。

Try using https://github.com/Fody/Costura/尝试使用https://github.com/Fody/Costura/

It's great for legacy .NET projects.它非常适合传统的 .NET 项目。 Newer frameworks have single-file executables as shown in their documentation较新的框架具有单文件可执行文件,如其文档中所示

Yes - with this (unpackaged / self-contained) command line:是的 - 使用这个(未打包/独立的)命令行:

dotnet publish -f net6.0-windows10.0.19041.0 -c Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true

Note: This requires Windows App SDK 1.1.0 or above.注意:这需要 Windows App SDK 1.1.0 或更高版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 调用 Bootstrap.Initialize() 时未打包的 WinUI3 应用程序崩溃 - Unpackaged WinUI3 app crashes when calling Bootstrap.Initialize() .NET 6.0 控制台应用程序作为独立的单文件可执行文件 - .NET 6.0 Console app as a self-contained single file executable 如何处理 .net core 3.1 自包含单文件发布的 Appsettings - How to handle Appsettings for .net core 3.1 self contained single file publish 如何使用 Windows 应用程序 SDK 在 WinUI 3 桌面中获取 DispatcherQueue - How to get DispatcherQueue in WinUI 3 Desktop using Windows App SDK 保持 WinUI 3 (Windows App SDK) window 始终位于底部 - Keep WinUI 3 (Windows App SDK) window always at bottom 在 Windows 中发布便携式和独立的 .NET 应用程序 7 - Publish Portable and Self-Contained .NET Application in Windows 7 WinUI 3 - Project Reunion 0.8(以及更高版本的 Windows App SDK)部署选项,如“XCOPY”(?) - WinUI 3 - Project Reunion 0.8 (and later Windows App SDK) Deployment Option like 'XCOPY' (?) 如何配置独立的单文件程序? - How to configure self-contained single-file program? 可以部署自包含的.NET Framework应用程序吗? - Is possible to deploy a self contained .NET Framework application? 您能否将资源发送到 .NET 5 中独立的单文件应用程序中的进程? - Can you send resources to a process in a self-contained, single file application in .NET 5?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM