[英]NuGet error restoring packages
Suddenly today I click Rebuild on my sln and get... 今天突然我在我的sln上单击“重建”并得到...
Error (~10 similar errors): 错误(〜10个类似错误):
Severity Code Description Project File Line Suppression State Error NuGet Package restore failed for project Core: Unable to find version '4.0.11' of package 'System.Diagnostics.Debug'.. 0 严重性代码说明项目文件行抑制状态错误NuGet项目Core的软件包还原失败:无法找到软件包“ System.Diagnostics.Debug”的版本“ 4.0.11”。0
System.Diagnostics.Debug 4.0.11 exists. System.Diagnostics.Debug 4.0.11存在。
Nuget version: 3.3.0.212 Nuget版本: 3.3.0.212
Other stuff: 其他的东西:
Error: 错误:
Install-Package : Some NuGet packages are missing from the solution. Install-Package:解决方案中缺少某些NuGet软件包。 The packages need to be restored in order to build the dependency graph. 需要还原软件包以构建依赖关系图。 Restore the packages before performing any operations. 在执行任何操作之前,请还原软件包。
This happened shortly after running windows update. 这是在运行Windows Update之后不久发生的。 I updated NuGet to 3.4 (from 3.3) and the issue resolved itself. 我将NuGet从3.3更新到3.4(此问题已解决)。
in Visual Studio > Tools > Extensions and Updates > Visual Studio Gallery > Nuget Package Manager > Update 在Visual Studio>工具>扩展和更新> Visual Studio库> Nuget软件包管理器>更新中
You need to check you have checked the “Allow NuGet to download missing packages” and “Automatically check for missing packages during build in Visual Studio” options under the VS Tools menu -> Options -> NuGet Packages Manager -> General tab. 您需要检查VS工具菜单->选项-> NuGet软件包管理器->常规选项卡下的“允许NuGet下载缺少的软件包”和“在Visual Studio中构建期间自动检查缺少的软件包”选项。
If the options are checked but the problem still exist, you need to uninstall all the installed NuGet and then reinstall them again. 如果已选中选项,但问题仍然存在,则需要卸载所有已安装的NuGet,然后再次重新安装它们。
And if uninstall and reinstall could not resolve this issue, you can manually remove the dependency with following steps which refer to this thread : 而且,如果卸载并重新安装不能解决此问题,则可以使用引用此线程的以下步骤来手动删除依赖项:
1.Close Visual Studio (not a hard requirement, but helpful). 1.关闭Visual Studio(这不是一个强制要求,但很有帮助)。 2.In text editor, remove dependency from packages.config. 2.在文本编辑器中,从packages.config中删除依赖项。 3.Remove package from packages/ directory. 3.从packages /目录中删除软件包。 4.In text editor, remove all references to package from .csproj file. 4.在文本编辑器中,从.csproj文件中删除对程序包的所有引用。 5.Start Visual Studio. 5.启动Visual Studio。 6.Reinstall package through NuGet. 6.通过NuGet重新安装软件包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.