Repository navigation
fix(sdk)!: Ship only the WebView2 native loader - #25996
Merged
Merged
Conversation
The webview feature's implicit Microsoft.Web.WebView2 reference is still needed: the WebView2Aot backend loads WebView2Loader.dll, which its own package does not ship. Its managed Core/WinForms assemblies and XML docs are unused since the Microsoft.Web.WebView2 backend removal, so restrict the reference to IncludeAssets="native". The implicit mswebview2 alias goes with the managed assemblies, and UnoWebView2Aliases is removed. The alias and WPF workaround targets stay: an explicit Microsoft.Web.WebView2 reference still needs them to avoid clashing with Uno's Microsoft.Web.WebView2.Core types. Refs #25216 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
ajpinedam
approved these changes
Nov 3, 2026
Xiaoy312
enabled auto-merge
November 3, 2026 22:17
This was referenced Nov 3, 2026
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25996/docs/index.html |
1 of 5 tasks
Contributor
Author
|
@Mergifyio backport release/stable/7.0 |
Contributor
✅ Backports have been createdDetails
|
1 of 5 tasks
agneszitte
added a commit
that referenced
this pull request
Nov 4, 2026
…7.0/pr-25996 fix(sdk)!: Ship only the WebView2 native loader (backport #25996)
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.
GitHub Issue: closes #25216
PR Type:
🐞 Bugfix
What changed? 🚀
Before: every desktop head with the
webviewfeature published the managedMicrosoft.Web.WebView2.Core.dllandMicrosoft.Web.WebView2.WinForms.dll, plus their XML docs (~1.4 MB). Nothing in Uno 7 uses them, because the Microsoft.Web.WebView2 backend was removed in #23757.After: the implicit
Microsoft.Web.WebView2reference isIncludeAssets="native". The package is still restored, because theWebView2Aotbackend loads its nativeWebView2Loader.dll(Win32WebView2Loader.Ensure) and theWebView2Aotpackage doesn't ship that file. Onlyruntimes/win-*/native/WebView2Loader.dllreaches the output now.UnoWebView2Aliases: removed, along with the implicitmswebview2alias. With no managed assets left, there is nothing to alias._UnoWebView2Workaroundand_UnoWebView2RemoveWpf: kept. An explicitMicrosoft.Web.WebView2reference still needs them. The package adds its managed references by hand, so a normalAliasessetting never reachesMicrosoft.Web.WebView2.Core. Without the workaround, the build fails with CS0433 against Uno's ownMicrosoft.Web.WebView2.Coretypes. SamplesApp is one such project.MicrosoftWebView2Version: kept, because it sets the loader's version.Validation
A scratch
net10.0-desktopapp (UnoFeatures=Hosting;webview) was published against a locally packedUno.Sdk.Private. ItsMaindoes whatWin32WebView2Loader.Ensuredoes, then callsGetAvailableCoreWebView2BrowserVersionString. It runs with a PATH limited toSystem32,Windowsanddotnet.WebView2Loader.dllin outputMicrosoft.Web.WebView2referenceUno.Sdk7.0.0-dev.67 (the issue's)Uno.Sdk7.0.0-dev.130 (same Uno.WinUI dev.2538 as the local rows)App.exe,dotnet App.dll, and a-r win-x64publish)mswebview2::…CoreWebView2EnvironmentSamplesApp
net10.0-desktopalso builds against this SDK. It imports the SDK from source and has an aliasedMicrosoft.Web.WebView2reference.This is a loader-level runtime check. It does not navigate a WebView.
PR Checklist ✅
Screenshots Compare Test Runresults.Breaking change
The implicit reference no longer brings the managed
Microsoft.Web.WebView2assemblies or themswebview2extern alias, andUnoWebView2Aliasesis ignored. An app that used the package's managed API through the implicit reference stops compiling. The fix is an explicit<PackageReference Include="Microsoft.Web.WebView2" Aliases="mswebview2" />, which the SDK still aliases correctly. This is documented inmigrating-to-uno-7.md.🤖 Generated with Claude Code