确认<UsingTask>声明是否正确。

8
我们从TFS下载了一个项目,在还原Nuget包后,出现以下错误:
Error   5   The "ValidatePackageReferences" task could not be loaded from the assembly projectPath\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.Tasks.dll. Could not load file or assembly 'file:///projectPath\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.  projectName

我们在任何地方都没有使用Task。看起来它正在内部使用。有什么指针可以帮助解决这个错误吗?主要看起来是由于NuGet包的版本错误引起的。但不确定根本原因。 我们使用的是VS 2013 Update 5版本。 图片链接:enter image description here

可能是这个问题的副本:未识别已安装的特定于项目的NuGet软件包 - Ahmed Masud
1
这不是重复的,而是特定软件包已知的错误。 - BrainSlugs83
2个回答

1
首先在谷歌上搜索"Microsoft.Bcl.Build.Tasks.dll." nuget。然后会打开一个名为"https://www.nuget.org/packages/Microsoft.Bcl.Build/"的链接。接着复制网站上显示的软件包名称,就像这样。
Install-Package Microsoft.Bcl.Build -Version 1.0.21

接着打开Visual Studio,进入“工具”>“Nuget程序包管理器”>“程序包管理器控制台”。现在粘贴复制的安装包并安装它。然后重新启动VS。问题将得到解决。


7
我想补充一下,重新启动Visual Studio就解决了我的问题。 - My Stack Overfloweth
1
简单的重启也对我起作用了。 - Brendan Sluke

0
我认为My Stack Overfloweth和Brendan Sluke的评论得到了许多人的赞同,应该是一个答案:
重新启动Visual Studio。
这就是它对我类似的“确认声明是否正确”的错误立即起作用的方式。
error MSB4062: The "Uno.Dsp.Tasks.GenerateFileTask" task could not be loaded from the assembly C:...\.nuget\packages\uno.dsp.tasks\1.2.7\build\../tools/Uno.Dsp.Tasks.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接