[3.119.x] Fix WinUI Projection DLL not resolved for .NET 9 consumers on Windows#4086
Merged
Merged
Conversation
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>
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 -- 4086PowerShell / Windows: iex "& { $(irm https://raw.githubusercontent.com/mono/SkiaSharp/main/scripts/get-skiasharp-pr.ps1) } 4086"Step 2 — Add the local NuGet source dotnet nuget add source ~/.skiasharp/hives/pr-4086/packages --name skiasharp-pr-4086More options
Or download manually from Azure Pipelines — look for the Remove the source when you're done: dotnet nuget remove source skiasharp-pr-4086 |
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
Backport of #4084 to release/3.119.x.
Fixes #4082 —
SkiaSharp.Views.WinUI.Native.Projectionassembly not found at runtime on Windows for .NET 9 apps (v3.119.4+).Root Cause
When TFMCurrent moved to
net10.0, the NuGet package placed the Projection DLL only inruntimes/win-{arch}/lib/net10.0-windows10.0.19041.0/. NuGet won't serve anet10.0asset to anet9.0consumer, causingFileNotFoundExceptionat runtime.Fix
Include the Projection DLL in all supported Windows TFM folders (both
WindowsTargetFrameworksCurrentandWindowsTargetFrameworksPrevious), so both .NET 9 and .NET 10 consumers can resolve it.