确认<usingtask>声明是否正确

时间:2017-10-30 23:25:08

标签: build msbuild msbuild-task nuget-package-restore

我们已经从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

我们没有在任何地方使用过任务。它似乎在内部使用。任何指针如何摆脱这个错误? 由于NuGet包的版本错误,它看起来很像。但不确定是什么原因。

我们正在使用VS 2013 Update 5版本。

enter image description here

1 个答案:

答案 0 :(得分:1)

首先搜索“Microsoft.Bcl.Build.Tasks.dll”。努力在谷歌上。然后将打开一个名为“https://www.nuget.org/packages/Microsoft.Bcl.Build/”的链接。然后复制网站上显示的包名称

Install-Package Microsoft.Bcl.Build -Version 1.0.21

然后打开Visual Studio,Goto Tools&gt; Nuget Package Manager&gt;包管理器控制台。现在粘贴复制的安装包,安装它。然后重新启动VS.Issue将被解决。