刚刚安装了 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()'
对于这种错误有什么解决办法吗?
最佳答案
有几个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/