1 Commits
Author SHA1 Message Date
poli0981andClaude Opus 4.7 4c1dba2dbd fix(release): v1.3.1 hotfix — copy .xbf + .pri to publish output
v1.3.0 shipped broken. The WinUI 3 publish pipeline silently omits two
file types from the self-contained publish output:

  1. .xbf — compiled XAML binary format (MainWindow.xbf, App.xbf, plus
     every Page/UserControl in CaptureImage.UI/Controls/ +
     CaptureImage.UI/Views/). Without these,
     Application.LoadComponent throws XamlParseException at runtime on
     every ms-appx:/// XAML reference.
  2. CaptureImage.App.pri — the app's compiled Package Resource Index.
     Without it, Windows can't resolve any ms-appx:/// URI at all,
     including the WinAppSDK theme resources at
     ms-appx:///Microsoft.UI.Xaml/Themes/themeresources.xaml.

Both files are produced into bin/Release/.../win-x64/ during build but
`dotnet publish --self-contained` skips them. v1.3.0 users got an installer
+ Velopack pack that ran fine, but the new app's MainWindow constructor
threw on InitializeComponent and the UI thread caught it via App.Unhandled-
Exception — process kept running, no window ever appeared. Silent failure.

Bisect:
- Local Debug bin works (XAML compiler outputs to obj/, .NET picks them
  up via Content items at runtime).
- Local Release bin works (.xbf + .pri land in bin/.../win-x64/).
- Local Release publish FAILS (.xbf + .pri NOT propagated to publish
  output) — same failure as the GitHub Actions release.yml.

Fix: add a custom MSBuild target `CopyWinUIArtifactsToPublishDirectory`
(AfterTargets="ComputeFilesToPublish") that explicitly adds every .xbf
plus $(AssemblyName).pri from $(OutDir) to ResolvedFileToPublish,
preserving the cross-assembly subfolder structure the XAML compiler
creates. Verified: publish-fix2/ now contains all 10 expected .xbf
(App, MainWindow, 4 Pages, 2 Controls, LogViewerView, PreviewWindow,
UpdatePage) + CaptureImage.App.pri; launched .exe completes full boot
path through Tray icon initialization.

Bumps version 1.3.0 → 1.3.1. CHANGELOG [1.3.1] hotfix section explains
the bug and recovery path for users already on broken v1.3.0 (Update
tab can't reach them since their window never opens — they need to
download the new Setup.exe manually).

Tests: 320/320 pass (Core 67 + Infra 60 + VM 22 + UI 171).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 12:36:20 +07:00
2 changed files with 56 additions and 1 deletions

No files matched your search

+27
View File
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [1.3.1] - 2026-04-26
**Critical hotfix.** v1.3.0 shipped broken — the WinUI 3 publish pipeline
omitted `.xbf` (compiled XAML binary) and `CaptureImage.App.pri` (resource
manifest) files from the self-contained publish output, so the installed
app silently failed at MainWindow.InitializeComponent on every launch
(the process stayed alive zombie-style; no window ever appeared). v1.2.x
auto-update users hit this on the first launch after Velopack restart.
### Fixed
- Add a `CopyWinUIArtifactsToPublishDirectory` MSBuild target to
`CaptureImage.App.csproj` that propagates every `.xbf` and the
`CaptureImage.App.pri` from `bin/.../win-x64/` into the publish
output, preserving the cross-assembly XAML resolution subfolders
(`CaptureImage.UI/Controls/`, `CaptureImage.UI/Views/`). `dotnet
publish` for unpackaged WinUI 3 self-contained apps doesn't include
these by default — known WinAppSDK gap.
### Recovery for v1.3.0 users
If you already updated to broken v1.3.0:
- The Update tab can't help (the app's window doesn't open).
- Download `CaptureImage-win-Setup.exe` from the v1.3.1 GitHub Release
and run it — the installer detects the existing install and replaces
it cleanly. Your `settings.json` and capture folder are untouched.
## [1.3.0] - 2026-04-26
UI framework migration from Avalonia 11 to **WinUI 3 (Windows App SDK 1.8.x)**
+29 -1
View File
@@ -16,7 +16,7 @@
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<DefineConstants>$(DefineConstants);DISABLE_XAML_GENERATED_MAIN</DefineConstants>
<Version>1.3.0</Version>
<Version>1.3.1</Version>
</PropertyGroup>
<ItemGroup>
@@ -41,6 +41,34 @@
<ProjectReference Include="..\CaptureImage.UI\CaptureImage.UI.csproj" />
</ItemGroup>
<!-- HOTFIX v1.3.1: WinUI 3 publish pipeline misses two file types when building
a self-contained unpackaged app via `dotnet publish`:
1. .xbf files — compiled XAML binary format produced by the WinUI 3 XAML
compiler. Without them, Application.LoadComponent fails on every
ms-appx:/// XAML reference at runtime with XamlParseException.
2. CaptureImage.App.pri — the app's compiled resource manifest. Without it,
Windows can't resolve ms-appx:/// URIs at all (incl. WinAppSDK theme
resources like ms-appx:///Microsoft.UI.Xaml/Themes/themeresources.xaml).
Both files are produced into bin/.../win-x64/ during build but `dotnet publish`
skips them in self-contained mode. v1.3.0 shipped without either and the
window never appeared (silent UI-thread crash; process stayed alive zombie).
This target adds every .xbf and .pri from $(OutDir) to the published file set,
preserving the CaptureImage.UI/Controls and CaptureImage.UI/Views subfolders
the XAML compiler creates for cross-assembly XAML resolution. -->
<Target Name="CopyWinUIArtifactsToPublishDirectory" AfterTargets="ComputeFilesToPublish">
<ItemGroup>
<_WinUIArtifactsToPublish Include="$(OutDir)**\*.xbf" />
<_WinUIArtifactsToPublish Include="$(OutDir)$(AssemblyName).pri" />
<ResolvedFileToPublish Include="@(_WinUIArtifactsToPublish)">
<RelativePath>%(RecursiveDir)%(Filename)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
<ItemGroup>
<Content Include="..\..\docs\legal\DISCLAIMER.md" Link="docs\legal\DISCLAIMER.md" CopyToOutputDirectory="PreserveNewest" />
<Content Include="..\..\docs\legal\PRIVACY.md" Link="docs\legal\PRIVACY.md" CopyToOutputDirectory="PreserveNewest" />