C# 在 .NET Framework 4.6.1 中使用 Microsoft.Toolkit.Win32.UI.Controls - Web 浏览器控件升级 [英] C# Using Microsoft.Toolkit.Win32.UI.Controls in .NET Framework 4.6.1 - Web Browser Control Upgrade

查看:70
本文介绍了C# 在 .NET Framework 4.6.1 中使用 Microsoft.Toolkit.Win32.UI.Controls - Web 浏览器控件升级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序在我的程序中使用 Web 浏览器控件已经有一段时间了,但它根本不再削减它,因为它无法在大多数网页上与 javascript 正常工作.幸运的是,微软已经发布一个新的网络浏览器工具供我们使用,它使用 EdgeHTML 驱动的 webview.nugget 包安装程序此处不起作用然而,在我的程序中.当我在包管理器控制台中运行它时,出现此错误

My program has been using the Web Browser Control for a while in my program, but it simply does not cut it anymore as it isn't able to work properly with the javascript on most webpages. Luckily, Microsoft has released a new web browser tool for us to use and it uses EdgeHTML powered webview. The nugget package installer here does not work in my program, however. When I run that in the package manager console, I get this error

安装失败.正在回滚...包项目中不存在Microsoft.Toolkit.Win32.UI.Controls.3.0.0"电子邮件分析器"包Microsoft.Toolkit.Win32.UI.Controls.3.0.0"文件夹 'C:\Users\thood\Desktop\Projects\Email 中不存在Analyzer\packages' 执行 nuget 操作需要 6.64 秒安装包:无法安装包'Microsoft.Toolkit.Win32.UI.Controls 3.0.0'.您正在尝试安装这个包到一个项目中'.NETFramework,Version=v4.6.1',但包不包含任何与之兼容的程序集引用或内容文件框架.有关更多信息,请联系软件包作者.在线:1字符:1+ 安装包 Microsoft.Toolkit.Win32.UI.Controls -Version 3.0.0+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception+ FullQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install failed. Rolling back... Package 'Microsoft.Toolkit.Win32.UI.Controls.3.0.0' does not exist in project 'Email Analyzer' Package 'Microsoft.Toolkit.Win32.UI.Controls.3.0.0' does not exist in folder 'C:\Users\thood\Desktop\Projects\Email Analyzer\packages' Executing nuget actions took 6.64 sec Install-Package : Could not install package 'Microsoft.Toolkit.Win32.UI.Controls 3.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package Microsoft.Toolkit.Win32.UI.Controls -Version 3.0.0 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

另外,这里是安装过程的对话

Additionally, here is the dialogue for the install process

PM> Install-Package Microsoft.Toolkit.Win32.UI.Controls -Version 3.0.0 

Attempting to gather dependency information for package 'Microsoft.Toolkit.Win32.UI.Controls.3.0.0' with respect to project 'Email Analyzer', targeting '.NETFramework,Version=v4.6.1'
Gathering dependency information took 1.91 sec
Attempting to resolve dependencies for package 'Microsoft.Toolkit.Win32.UI.Controls.3.0.0' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Microsoft.Toolkit.Win32.UI.Controls.3.0.0'
Resolved actions to install package 'Microsoft.Toolkit.Win32.UI.Controls.3.0.0'
Retrieving package 'Microsoft.Toolkit.Win32.UI.Controls 3.0.0' from 'nuget.org'.
GET https://api.nuget.org/v3-flatcontainer/microsoft.toolkit.win32.ui.controls/3.0.0/microsoft.toolkit.win32.ui.controls.3.0.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/microsoft.toolkit.win32.ui.controls/3.0.0/microsoft.toolkit.win32.ui.controls.3.0.0.nupkg 305ms
Installing Microsoft.Toolkit.Win32.UI.Controls 3.0.0.

这仅仅是因为 4.6.1 不支持该工具包吗?将我的程序回滚到 3.0.0 并不是一个真正的选择,因为我使用了对 System.Threading.Tasks 的引用,而这在 3.0.0 中是不可用的.有没有人运行 4.6.1 能够成功集成新工具包?

Is this simply because the toolkit is not supported for 4.6.1? Rolling my program back to 3.0.0 is not really an option because I use references to System.Threading.Tasks which is not available in 3.0.0. Has anyone running 4.6.1 been able to successfully integrate the new toolkit?

推荐答案

好的,这是交易,有两个步骤可以解决这个问题.希望如果其他人遇到此错误,我的回答将能够为您节省一些时间.我将通过链接将其分为 2 个简单步骤.

Ok, here's the deal, there's two steps to solve this issue. Hopefully if anyone else gets this error my answer will be able to save you all some time. I'll break this into 2 easy steps with links.

  1. 首先,您需要阅读这篇文章关于如何更新您的框架.当您进入目标框架:"下拉菜单时,您需要选择安装其他框架..."并找到并下载并运行 4.6.2.完成.

  1. First you'll want to read this article on how to update your framework. When you get to the "Target Framework:" dropdown, you'll want to select "Install other frameworks..." and find and download and run 4.6.2. Done.

接下来,您需要查看正在运行的 Windows 版本.按照此操作:开始 > 设置(左下角的齿轮图标)> 系统 > 关于(左面板底部)> 向下滚动到Windows 规格"> 检查您的版本.如果您正在运行 1803,那太好了 - 到此您都已完成!如果您像我一样并且尚未使用 1803 版(我使用的是 1709 版),请转到 在这里,然后单击立即更新"以在您的 PC 上下载安装程序.找到安装程序并运行.这将需要一段时间才能完成安装,因此请耐心等待并在需要时插入您的 PC.

Next, you'll want to see what version of Windows you are running. Follow this: Start > Settings (gear icon towards bottom left) > System > About (bottom of left panel) > Scroll down to "Windows specifications" > Check your version. If you are running 1803, great - you're all done here! If you're like me and not already on version 1803 (I was on 1709) go here and click "Update Now" to download the installer on your PC. Find the installer and run. This will take awhile to finish installing so be patient and plug in your PC if you need to.

就是这样.安装后,您应该可以在 Visual Studio 4.6.2 中使用 WebViewControl!干杯!

That's it. Once this is installed you should be able to use WebViewControl in Visual Studio 4.6.2! Cheers!

这篇关于C# 在 .NET Framework 4.6.1 中使用 Microsoft.Toolkit.Win32.UI.Controls - Web 浏览器控件升级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆