c# - 我可以在 Visual Studio 2015 中使用 Edge 加载 WebView 吗?

标签 c# winforms visual-studio-2015 microsoft-edge

刚刚安装了 Nuget,“Microsoft.Toolkit.Forms.UI.Controls.WebView”并尝试使用网络浏览器“Edge”,但是当我将控件拖到表单中时,它给了我一个异常:

"Failed to create webview. The error is message following: System.TypeLoadExcpetion: Could not find Windows.runtime type: Could not find windows.runtime type : Windows.Web.UI.interop.WebViewControlProcess at microsoft.toolkit.Form.UI.Controls..WebView.get_Enterprise()'

对于这种错误有什么解决办法吗?

enter image description here

最佳答案

有几个prerequisites在 Windows 窗体应用程序中使用工具包控件:

  • Visual Studio 2017.
  • Windows 10 Insider Preview Build 17110 or a later release.
  • .NET Framework 4.6.2 or a later release.
  • Configure your application for high DPI support. To learn how, see this section of the guide.

更新到最新版本的 Visual Studio 2017。

更新到 Windows 10 的最新可用版本(最好是 2018 年 10 月更新及更高版本)。

通过右键单击解决方案资源管理器中的项目并选择属性,确保您的项目面向.NET Framework 4.6.2或更高版本 。我认为这可能是您的问题最有可能的原因。

基于 this 启用 HDPI 支持指南。

关于c# - 我可以在 Visual Studio 2015 中使用 Edge 加载 WebView 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53432407/

相关文章:

c# - 将 base64Binary 转换为 pdf

c# - 为 LDAP 查询转义字符串中的非特殊字符

c# - 如何使用不同的控件集绘制同一区域?

c# - 获取值作为 DateTime,但在 DropDownList 中显示为 DateTime.Year(使用 LINQ)

c# - 高效的 Delaunay 三角剖分

c# - 在 WinForms 上反转颜色

winforms - 由于Microsoft.ReportingServices.Rendering.RichText.CachedFont GetFont,ReportViewer崩溃

c++ - 应用程序无法正常启动(0xc00007b)

javascript - "require"或 "import"模块化 javascript ASP.Net MVC 5、Visual Studio 2015 的最简单方法

c# - 如何使用 Visual Studio 2015 注册 .NET Core 1.1 RTM 的自定义项模板?