Fix WinUI Projection DLL not resolved for .NET 9 consumers on Windows#4084
Merged
mattleibow merged 1 commit intoMay 29, 2026
Conversation
Contributor
📦 Try the packages from this PRWarning Do not run these scripts without first reviewing the code in this PR. Step 1 — Download the packages bash / macOS / Linux: curl -fsSL https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.sh | bash -s -- 4084PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4084"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4084/packages --name skiasharp-pr-4084More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4084 |
The NativeAssets.WinUI package placed the Projection DLL only in the net10.0-windows folder (WindowsTargetFrameworksCurrent). Since NuGet won't serve a higher TFM asset to a lower TFM consumer, .NET 9 apps couldn't resolve the assembly at runtime, causing FileNotFoundException. Fix by including the Projection DLL in ALL supported TFMs (both Current and Previous), ensuring every consumer TFM gets the assembly. This mirrors the pattern where lib/ placeholders exist for each TFM. Fixes #4082 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mattleibow
force-pushed
the
mattleibow/issue-4082-bug-3-119-4-and-4-147-0-preview-3-1-do-17d09a
branch
from
May 27, 2026 23:38
1bf2911 to
8f542ce
Compare
Contributor
|
📖 Documentation Preview The documentation for this PR has been deployed and is available at: 🔗 View Staging Site This preview will be updated automatically when you push new commits to this PR. This comment is automatically updated by the documentation staging workflow. |
This was referenced May 28, 2026
mattleibow
deleted the
mattleibow/issue-4082-bug-3-119-4-and-4-147-0-preview-3-1-do-17d09a
branch
May 29, 2026 17:07
mattleibow
added a commit
that referenced
this pull request
May 29, 2026
[3.119.x] Fix WinUI Projection DLL not resolved for .NET 9 consumers on Windows (#4086) Fixes: #4082 Cherry-pick of: #4084 Backport of the same fix to the 3.119.x release branch. The Projection DLL was only placed in `runtimes/win-{arch}/lib/net10.0-windows10.0.19041.0/`, which NuGet won't serve to net9 consumers. .NET 9 apps hit a `FileNotFoundException` for `SkiaSharp.Views.WinUI.Native.Projection` at startup. Include the Projection DLL in both the `$(WindowsTargetFrameworksCurrent)` (net10.0) and `$(WindowsTargetFrameworksPrevious)` (net9.0) runtime folders so NuGet resolves it for both .NET 9 and .NET 10 consumers. Co-authored-by: Matthew Leibowitz <mattleibow@live.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jun 9, 2026
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.
Summary
Fixes #4082 —
SkiaSharp.Views.WinUI.Native.Projectionassembly not found at runtime on Windows for .NET 9 apps (v3.119.4+).Root Cause
When the primary TFM moved from
net8.0tonet10.0(TFMCurrent), theNativeAssetPackageFileentries inSkiaSharp.NativeAssets.WinUI.csprojplaced the Projection DLL only into:NuGet's TFM resolution won't serve a
net10.0asset to anet9.0consumer (higher TFM isn't backward-compatible), so .NET 9 apps get aFileNotFoundExceptionat runtime.In v3.119.2 (TFMCurrent=net8.0): The DLL was in
runtimes/win-{arch}/lib/net8.0-windows10.0.19041.0/— accessible to both net8 and net9 consumers.Fix
Include the Projection DLL in all supported Windows TFM folders (
WindowsTargetFrameworksCurrentandWindowsTargetFrameworksPrevious), so the NuGet package serves it to both .NET 9 and .NET 10 consumers.Resulting package layout:
Testing