Skip to content

fix: remove obsolete WebView2 SDK wiring - #25315

Closed
Doomguy-BFG9000 wants to merge 2 commits into
unoplatform:masterfrom
Doomguy-BFG9000:fix/remove-obsolete-webview2-sdk-wiring
Closed

Doomguy-BFG9000 wants to merge 2 commits into
unoplatform:masterfrom
Doomguy-BFG9000:fix/remove-obsolete-webview2-sdk-wiring

Conversation

@Doomguy-BFG9000

@Doomguy-BFG9000 Doomguy-BFG9000 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #25216

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

Remove obsolete WebView2 SDK wiring while preserving the generated package behavior.

Testing

  • Uno.Sdk build and pack completed successfully. Packed-SDK evaluation passed.

Compatibility note

This change intentionally removes the MicrosoftWebView2Version, UnoWebView2Aliases, and UnoDisableWebView2Workarounds SDK properties. Existing settings are ignored after this change. The Uno 7 migration guide now documents the removal and explains how direct WebView2 consumers can use an explicit package reference with standard Aliases metadata.

Additional validation: SamplesApp built successfully for net10.0-desktop with 0 warnings and 0 errors.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable)
  • 📚 Docs have been added or updated (not applicable to this focused code change)
  • 🖼️ Validated PR Screenshots Compare Test Run results
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated)

@CLAassistant

CLAassistant commented Oct 12, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions Bot added the area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk label Oct 12, 2026

@morning4coffe-dev morning4coffe-dev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified by code review at head 06488e2: the removed SDK wiring (targets, ImplicitPackagesResolver, PackageManifest, packages.json, buildschema), the remaining references to the removed names, runtime use of WebView2 (WebView2Aot), and the X11 addin's WebView2 type sources. The issue #25216 expected behavior matches the diff.

COMMENT

Findings (ranked):

  1. (Medium, docs out of date) doc/articles/migrating-to-uno-7.md:117 (on master, not touched by this PR) tells users to set <UnoDisableWebView2Workarounds>true</UnoDisableWebView2Workarounds> to keep the WPF reference and the alias workaround. This PR removes that property and the _UnoWebView2Workaround / _UnoWebView2RemoveWpf targets, so the documented setting now does nothing. Update the migration guide in this PR.
  2. (Medium, unverified build risk) src/SamplesApp/SamplesApp/SamplesApp.csproj:234 has an explicit <PackageReference Include="Microsoft.Web.WebView2" Aliases="MsWebView2" /> in the desktop ItemGroup. The removed _UnoWebView2Workaround target applied the alias to the Microsoft.Web.WebView2.Core ReferencePath for every PackageReference with Aliases metadata, and that path includes this one. Uno.UI ships its own Microsoft.Web.WebView2.Core stubs (src/Uno.UI/Generated/3.0.0.0/Microsoft.Web.WebView2.Core/), so without the alias the two definitions may collide in the SamplesApp desktop head. No desktop build ran in CI for this PR. Please build SamplesApp for net10.0-desktop (for example with -p:UnoTargetFrameworkOverride=net10.0-desktop) before merging.
  3. (Low, PR checklist) "Contains NO breaking changes" is not quite accurate. The buildschema entry MicrosoftWebView2Version, plus the UnoWebView2Aliases and UnoDisableWebView2Workarounds properties, are removed; setting them now silently does nothing. This is probably acceptable in the 7.0 dev cycle, but state it in the PR body and in the migration guide.
  4. (Positive, no action) The runtime uses only WebView2Aot (src/Uno.UI.Runtime.Win32/Uno.UI.Runtime.Win32.csproj:29). The X11 addin's Microsoft.Web.WebView2.Core types come from Uno.UI's generated stubs, so it does not depend on the removed package. Nothing else in the tree references MicrosoftWebView2Version, UnoWebView2Aliases or the MicrosoftWebView2 group.

Not validated: I did not run dotnet build or dotnet pack, and the author's "Uno.Sdk build and pack completed successfully / packed-SDK evaluation passed" is author-reported. The PR's CI shows only triage, docs, Codacy, WIP and summary checks; no build job ran, so item 2 is not covered by CI.

@morning4coffe-dev

Copy link
Copy Markdown
Member

Hi @Doomguy-BFG9000, thanks a lot for this contribution! 🙏 Before we can merge it, could you please sign our Contributor License Agreement? The CLA assistant link is in the bot comment above: https://cla-assistant.io/unoplatform/uno?pullRequest=25315. It only takes a minute. Thank you!

@Doomguy-BFG9000

Copy link
Copy Markdown
Contributor Author

Addressed the review in 4461546:

  • Updated the Uno 7 migration guide to document removal of MicrosoftWebView2Version, UnoWebView2Aliases, and UnoDisableWebView2Workarounds.
  • Removed the obsolete MicrosoftWebView2Version entry from the SDK property documentation.
  • Updated the PR compatibility disclosure.
  • Built SamplesApp for net10.0-desktop: 0 warnings, 0 errors.
  • Verified that Microsoft.Web.WebView2.Core.dll retains Aliases=MsWebView2, so it does not collide globally with Uno's generated WebView2 types.

git diff --check also passes.

@unodevops

Copy link
Copy Markdown
Contributor

@MartinZikmund

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 239269 found UI Test snapshots differences: skia-linux-screenshots: 118, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 118 changed over 2458

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CalendarView_Theming.png-dark
    • CalendarView_Theming.png
    • ClipboardTests.png-dark
    • Buttons.png-dark
    • Buttons.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • CompositionNineGridBrush_Source_Changes.png-dark
    • CompositionNineGridBrush_Source_Changes.png
    • DynamicFont.png-dark
    • DynamicFont.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Focus_FocusVisual_Properties.png-dark
    • Focus_FocusVisual_Properties.png
    • Examples.png
    • ImageBrushAlignmentXY.png-dark
    • ImageBrushAlignmentXY.png
  • skia-windows-screenshots: 2458 changed over 2488

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AppBarButtonTest.png
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSizing.png-dark
    • ApplicationViewSpanningRectsPage.png
    • AppWindowPositionAndSize.png-dark
    • AppXamlDefinedResources.png-dark
    • ArcSegment.png-dark
    • Attributed_text_Simple.png-dark
    • Attributed_text_Simple.png
    • AutoBorderStretchwithleftmargin.png-dark
    • AutoBorderStretchwithleftmargin.png
    • AutomationProperties_Landmark.png
    • AutomationProperties_Name.png-dark
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • AutoSuggestBox_BitmapIcon.png-dark
    • AutoSuggestBox_BitmapIcon.png
    • BadgeNotificationTests.png-dark
    • BadgeNotificationTests.png

@Xiaoy312

Xiaoy312 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for picking this up, and for the thorough cleanup across the SDK, schema and docs. While validating it, though, we found that removing the package completely causes two regressions:

  1. The WebView no longer loads on Windows. The WebView2Aot backend loads the native WebView2Loader.dll (Win32WebView2Loader.Ensure), and the WebView2Aot package doesn't ship that file; Microsoft.Web.WebView2 is where it comes from. With this change, a published webview desktop app has no WebView2Loader.dll. On a machine without one on PATH, the WebView fails with DllNotFoundException. The build itself succeeds. This is easy to miss locally: the Windows Performance Toolkit, for example, puts a WebView2Loader.dll on PATH, which hides the missing file.
  2. Projects that reference Microsoft.Web.WebView2 themselves fail to build with CS0433. The package adds its managed references by hand, so a normal Aliases setting never reaches Microsoft.Web.WebView2.Core. _UnoWebView2Workaround is what applies the alias. Without it, the package's CoreWebView2 clashes with Uno's own Microsoft.Web.WebView2.Core types. SamplesApp is one such project, so the migration note's suggestion to use standard Aliases metadata doesn't work either.

#25996 takes a narrower approach. The implicit reference becomes IncludeAssets="native", so only the loader ships and the managed dlls and XML docs are gone. UnoWebView2Aliases is removed. The workaround targets and MicrosoftWebView2Version stay. The details and red/green results are in this comment on #25216.

Since #25996 replaces this PR, I'll close this one. Thanks again for the investigation, which is what led to the fix.

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 kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uno.Sdk still adds Microsoft.Web.WebView2 to desktop heads after the Microsoft.Web.WebView2 backend was removed

7 participants