uwp - WinUI 3.0 - 为什么 UWP 项目要求 MS Edge for Business 用于 WebView2
问题描述
当我在项目中使用WebView2
控件并运行应用程序时,控件内的网页不显示。相反,该应用会显示以下消息,将我带到Microsoft Edge for Business下载页面:UWP
WinUI 3.0
WebView2
未检测到合适的 Microsoft Edge 版本。请从此处安装最新的 beta 频道版本
问题:为什么它要求使用 Microsoft Edge for Business?我MS Edge Canary Channel
的Windows 10 - Pro
. 我不想安装太多版本。
MainPage.xaml:
<Page
x:Class="UWP_WinUI.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UWP_WinUI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button x:Name="myButton" Click="myButton_Click">Click Me</Button>
<WebView2 x:Name="wvTest" Grid.Row="1" Source="https://www.bing.com/"/>
</Grid>
</Page>
应用程序的显示
该网页应该显示在WebVeiw2
按钮控件的下方。但相反,会显示消息(如下所示):
解决方案
对于“WinUI 3.0 Desktop”,它现在是 WebView2 的支持平台,请查看此站点了解详细信息:https ://docs.microsoft.com/en-us/microsoft-edge/webview2/gettingstarted/winui 。
如果您计划发布您的 WinUI 3.0 应用程序是 UWP 应用程序,那么可能会有一些限制,坦率地说,我不确定该组合。
推荐阅读
- android - OnBackPress 应用程序从 Activity 返回到 Fragment 时崩溃
- c# - 如何使用 switch 实例化一个类,然后访问和更改其属性
- windows - 批处理文件中需要绝对路径?
- .net - Minio Azure 网关和 .Net SDK
- amazon-web-services - AWS ElasticSearch - 在 Kibana 中限制或过滤数据
- r - cowplot 中的 draw_image() 函数导致 pdf 模糊
- java - 将构造函数作为参数传递给方法
- php - 如何在 jqgrid 中显示添加表单?
- parallel-processing - 重用变量对指令级并行性和 OoO 执行不利吗?
- java - 如何使用偏移量解析日期时间