DesktopHTMLViewer uses WebView2 when building for WinUI

2026R2 added this new feature:

DesktopHTMLViewer now uses WebView2 when building for WinUI

Link

I’m trying to understand how this works. In the IDE, an DesktopHTMLViewer does not have any instance settings that apply:

However, in Build Settings / Windows / Advanced Build, I see this:

I’m confused - there are separate settings for “HTMLViewer uses WebView2” and “Use WinUI (Experimental)”.

The release notes say “DesktopHTMLViewer now uses WebView2 when building for WinUI

Do we have to enable both settings?

I found more detail in the release notes which may explain it:

Windows : DesktopHTMLViewer now uses WebView2 when targeting WinUI. For non-WinUI Windows targets, WebView2 can be selected as the HTMLViewer backend through the Windows Advanced Build Settings.

I interpret this to mean:

  • WinUI build? DesktopHTMLViewer will use WebView2
  • Non-WinUI Build? you can choose by the Advanced Build settings.

Perhaps this blog post will help clarify things, but you can use the WebView2 based DesktopHTMLViewer on non-WinUI Windows targets too with that advanced build setting. For WinUI targets the WebView2 based DesktopHTMLViewer is your only option.

1 Like