Skip to content

fix(sdk)!: Ship only the WebView2 native loader (backport #25996) - #26015

Merged
agneszitte merged 1 commit into
release/stable/7.0from
mergify/bp/release/stable/7.0/pr-25996
Nov 4, 2026
Merged

agneszitte merged 1 commit into
release/stable/7.0from
mergify/bp/release/stable/7.0/pr-25996

Conversation

@mergify

@mergify mergify Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25216

PR Type:

🐞 Bugfix

What changed? 🚀

Before: every desktop head with the webview feature published the managed Microsoft.Web.WebView2.Core.dll and Microsoft.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.WebView2 reference is IncludeAssets="native". The package is still restored, because the WebView2Aot backend loads its native WebView2Loader.dll (Win32WebView2Loader.Ensure) and the WebView2Aot package doesn't ship that file. Only runtimes/win-*/native/WebView2Loader.dll reaches the output now.

  • UnoWebView2Aliases: removed, along with the implicit mswebview2 alias. With no managed assets left, there is nothing to alias.
  • _UnoWebView2Workaround and _UnoWebView2RemoveWpf: kept. An explicit Microsoft.Web.WebView2 reference still needs them. The package adds its managed references by hand, so a normal Aliases setting never reaches Microsoft.Web.WebView2.Core. Without the workaround, the build fails with CS0433 against Uno's own Microsoft.Web.WebView2.Core types. SamplesApp is one such project.
  • MicrosoftWebView2Version: kept, because it sets the loader's version.

Validation

A scratch net10.0-desktop app (UnoFeatures=Hosting;webview) was published against a locally packed Uno.Sdk.Private. Its Main does what Win32WebView2Loader.Ensure does, then calls GetAvailableCoreWebView2BrowserVersionString. It runs with a PATH limited to System32, Windows and dotnet.

SDK Managed WebView2 dll/xml in output WebView2Loader.dll in output Loader check App with its own aliased Microsoft.Web.WebView2 reference
published Uno.Sdk 7.0.0-dev.67 (the issue's) shipped ✅ ✅ not run
published Uno.Sdk 7.0.0-dev.130 (same Uno.WinUI dev.2538 as the local rows) shipped ✅ ✅ not run
master shipped ✅ ✅ ✅ builds
without the package (as in #25315) gone ❌ missing ❌ load fails ❌ CS0433 (same targets removed as in the next row; not run against this SDK)
without the package's managed assets, workaround targets removed gone ✅ ✅ ❌ CS0433
this PR gone ✅ ✅ (App.exe, dotnet App.dll, and a -r win-x64 publish) ✅ builds and uses mswebview2::…CoreWebView2Environment

SamplesApp net10.0-desktop also builds against this SDK. It imports the SDK from source and has an aliased Microsoft.Web.WebView2 reference.

This is a loader-level runtime check. It does not navigate a WebView.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable): N/A, this is SDK packaging. It was validated with the scratch publish above.
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features): migration guide row.
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

Breaking change

The implicit reference no longer brings the managed Microsoft.Web.WebView2 assemblies or the mswebview2 extern alias, and UnoWebView2Aliases is 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 in migrating-to-uno-7.md.

🤖 Generated with Claude Code


This is an automatic backport of pull request #25996 done by [Mergify](https://mergify.com).

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]>
(cherry picked from commit ec52817)
@Xiaoy312 Xiaoy312 added kind/breaking-change 💥 Categorizes an issue or PR as requiring a breaking change to be fixed. area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk area/webview Categorizes an issue or PR as relevant to the WebView control kind/bug Something isn't working platform/desktop 🖥️ Categorizes an issue or PR as relevant to Desktop labels Nov 4, 2026
@github-actions github-actions Bot added kind/documentation and removed kind/bug Something isn't working area/webview Categorizes an issue or PR as relevant to the WebView control kind/breaking-change 💥 Categorizes an issue or PR as requiring a breaking change to be fixed. area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk platform/desktop 🖥️ Categorizes an issue or PR as relevant to Desktop labels Nov 4, 2026
@Xiaoy312 Xiaoy312 added kind/breaking-change 💥 Categorizes an issue or PR as requiring a breaking change to be fixed. area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk area/webview Categorizes an issue or PR as relevant to the WebView control kind/bug Something isn't working platform/desktop 🖥️ Categorizes an issue or PR as relevant to Desktop labels Nov 4, 2026
@mergify mergify Bot mentioned this pull request Nov 4, 2026
1 of 5 tasks
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@Xiaoy312
Xiaoy312 enabled auto-merge November 4, 2026 02:29
@mergify

mergify Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@agneszitte
agneszitte merged commit 1deb5c3 into release/stable/7.0 Nov 4, 2026
52 of 53 checks passed
@agneszitte
agneszitte deleted the mergify/bp/release/stable/7.0/pr-25996 branch November 4, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk area/webview Categorizes an issue or PR as relevant to the WebView control kind/breaking-change 💥 Categorizes an issue or PR as requiring a breaking change to be fixed. kind/bug Something isn't working kind/documentation platform/desktop 🖥️ Categorizes an issue or PR as relevant to Desktop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants