UWP WebView2 not working with WebView2 Runtime installed

家住魔仙堡 提交于 2021-01-05 12:45:27

问题


I've created a WinUI 3.0 UWP application and installed the WebView2 runtime as per documentation. When I inspect the regkey and its pv property, per documentation, it is set. However, when launching my app, regardless of in debug or release, I see the A suitable version of Microsoft Edge was not detected

The XML itself is extremely simple:

<Grid>

<Grid.RowDefinitions>
    <RowDefinition Height="Auto" />
    <RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>

<controls:WebView2 x:Name="MyWebView"  Grid.Row="1" Grid.ColumnSpan="2" 
    Source="https://www.microsoft.com" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />

The documentation states that it should be possible to rely on the WebView2 runtime for development as well:

During development and testing, you may use either as the backing web platform.

  • The WebView2 Runtime
  • Any Insider (non-stable) Microsoft Edge (Chromium) browser channel

Have anyone managed to get this running without installing a BETA release of Microsoft Edge directly as this is not an option nor is it recommended.


回答1:


See the prerequisites in Getting started with WebView2 in WinUI 3

Introduction to Microsoft Edge WebView2

To see which version of MS Edge is required for a particular version of WebView2, see the WebView2 Release Notes.

Download the latest development build of MS Edge from https://www.microsoftedgeinsider.com/en-us/download.

The following post shows some things that you can check to determine the MS Edge version(s) you have installed. How to detect if runtime is installed? #421



来源:https://stackoverflow.com/questions/64703071/uwp-webview2-not-working-with-webview2-runtime-installed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!