Repository navigation
build(deps): pin ReactiveUI.Avalonia to AtomUI's version, ship ReadyToRun Windows builds - #15
Merged
Merged
Conversation
added 2 commits
November 30, 2026 23:54
…gainst AtomUI.Desktop.Controls 6.3.x declares ReactiveUI.Avalonia 12.0.3, i.e. it is built against ReactiveUI 23.2.x where IViewFor lives in the ReactiveUI namespace. PR #8 (.NET 11 upgrade) moved the adapter to 12.1.9, which pulls ReactiveUI 28 and moved IViewFor to ReactiveUI.Binding, so AtomUI's IL references a type the shipped assembly no longer contains: crossgen2: Failed to load type 'ReactiveUI.IViewFor' That broke every ReadyToRun and NativeAOT publish, and left a latent TypeLoadException for any AtomUI path that touches the view locator. Pin the adapter back to AtomUI's declared dependency so both sides agree. Verified: build 0 warnings, 790/790 tests, R2R publish succeeds, app reaches the main window with Avalonia 12.2.0.
Now that ReactiveUI.Avalonia matches AtomUI, crossgen2 compiles the full dependency graph again, so the Windows artifact can be ReadyToRun. Measured on win-x64 (time from process start to a visible main window, warm cache, 4 runs): plain single-file 162.6 MB 4.14-4.23 s R2R single-file 313.2 MB 1.56-1.65 s R2R single-file + compression 127.0 MB 2.07-2.13 s Compression costs ~0.5 s at launch but keeps the artifact 22% smaller than the current release, so R2R + compression is the only variant that is both faster and smaller. Linux and macOS keep the plain publish for now: they publish a loose directory rather than a single file, where R2R grows the payload ~25% with no compression to claw it back.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
AtomUI.Desktop.Controls 6.3.x 的 nuspec 声明
ReactiveUI.Avalonia >= 12.0.3,即它是对着 ReactiveUI 23.2.28 编译的 —— 那个版本里IViewFor在ReactiveUI命名空间。PR #8(.NET 11 升级)把适配器提到 12.1.9,连锁拉进 ReactiveUI 28,而 28 把IViewFor挪到了ReactiveUI.Binding。结果 AtomUI 的 IL 引用了一个发不出来的类型:
所有
PublishReadyToRun和PublishAot发布会直接失败;运行时也埋着一颗雷 —— 任何走到 view locator 的 AtomUI 路径都会TypeLoadException。改动
CxShell.csproj:ReactiveUI.Avalonia12.1.9 → 12.0.3(AtomUI 声明的版本),并加注释说明必须和 AtomUI 一起升。项目自身只在Program.cs调用.UseReactiveUI(),没有 XAML/代码依赖 ReactiveUI 类型,降版无接口损失。.github/workflows/release.yml:Windows 发布加-p:PublishReadyToRun=true -p:EnableCompressionInSingleFile=true。验证
dotnet test790/790 通过。-p:PublishReadyToRun=true发布成功,crossgen2 不再报错。启动耗时(win-x64,进程启动到主窗口可见,4 次取样):
压缩比不压缩慢约 0.5 s(首次运行需解包到缓存目录),但体积比现在的发布还小 22%,是唯一「又小又快」的组合。Linux/macOS 保持原样:它们发的是目录而不是单文件,R2R 会让 payload 涨约 25%,没有压缩来抵消。