Confirm that the <UsingTask> declaration is correct

user2243747 picture user2243747 · Oct 31, 2017 · Viewed 9.8k times · Source

We have downloaded a project from TFS and after restoring Nuget packages we are getting below error:

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

We have not used Task anywhere. It seems it is being used internally. Any pointer how to get rid of this error? Mostly it looks like its because of wrong version of NuGet package. But not sure whats root cause.

We are using VS 2013 Update 5 version.

enter image description here

Answer

Varinder Singh Baidwan picture Varinder Singh Baidwan · May 8, 2018

First search "Microsoft.Bcl.Build.Tasks.dll." nuget on google. Then a link will be opened with named "https://www.nuget.org/packages/Microsoft.Bcl.Build/". Then copy the package name shown on the site like this

Install-Package Microsoft.Bcl.Build -Version 1.0.21

Then Open the Visual studio , Goto Tools>Nuget Package Manager>Package manager console. Now paste the copied install package,Install it. Then restart the VS.Issue will be solved.