scighost / winui3keng Goto Github PK
View Code? Open in Web Editor NEWWinUI 3 踩坑记
License: MIT License
WinUI 3 踩坑记
License: MIT License
在”第一个窗口“ 设置背景 所引用的库中,大多数命名已经更改,但在文章中并没有更改
最新的 Windows App SDK v1.6 预览版 1 已经较好地支持了 PublishSingleFile
与 WindowsAppSDKSelfContained
的组合。
而且现在,TrimMode
设为 full
也不会出现很大的问题了。
一些关键的配置如下:
<!-- 高版本 WASDK 的必需属性 -->
<WindowsSdkPackageVersion>10.0.22621.35-preview</WindowsSdkPackageVersion>
<!-- 不打包 -->
<WindowsPackageType>None</WindowsPackageType>
<!-- 启用剪裁,现在用 full 模式没有很大的问题了 -->
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>full</TrimMode>
<!-- 自包含 .NET 运行时 -->
<SelfContained>true</SelfContained>
<!-- 单文件 -->
<PublishSingleFile>true</PublishSingleFile>
<!-- 启用单文件发布的必需属性 -->
<EnableMsixTooling>true</EnableMsixTooling>
<!-- 关闭 ReadyToRun -->
<PublishReadyToRun>false</PublishReadyToRun>
<!-- 自包含 Windows App Runtime 运行时 -->
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<!-- 压缩发布的文件 -->
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
引用包的版本如下:
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.0-prerelease.240602.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240531000-experimental1" />
Microsoft.Windows.CsWinRT
包是必须的,否则裁剪后应用会出问题。
以上。
我的一个程序功能是点击按钮,弹窗登录Microsoft账户,弹窗由CommunityToolkit.Authentication.Msal处理。但是Trim后这个窗口就会不出现,请问大佬有没有相关解决经验?
// Package
CommunityToolkit.Authentication = 7.1.4
CommunityToolkit.Authentication.Msal = 7.1.4
CommunityToolkit.Graph = 7.1.4
CommunityToolkit.Mvvm = 8.2.1
CommunityToolkit.WinUI.UI = 7.1.2
Microsoft.Extensions.DependencyInjection = 7.0.0
Microsoft.WindowsAppSDK = 1.3.230602002
private readonly IProvider _provider = ProviderManager.Instance.GlobalProvider;
public async Task Login()
{
await _provider.SignInAsync();
}
最近整了一个 Win UI 3 试着写了个客户端玩
问题多多少少都解决了,到现在一个 Github Action 的 yml 写了我一晚上都没能解决,最多只能成功 Build,打包后的 msix 不知道微软藏哪了,它们的 CI 文档写的不清晰,感觉就像在摸石头过河似的(
感觉微软对 Win UI 3 的项目不是很上心
Set up continuous integration for your WinUI 3 app
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.