错误22无法从程序集加载“EnsureBindingRedirects”任务

我用vs 2013克隆了一个项目。当我运行它时,我得到了这个错误。

Error 1 The "EnsureBindingRedirects" task could not be loaded from the assembly D:\BMaster\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.Tasks.dll. Could not load file or assembly 'file:///D:\BMaster\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.Tasks.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the  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. BargainMaster.Web 

我不确定这个问题的根本原因,但是当我手动添加缺少的库时它出现了。

我通过这样解决了它:

  1. 删除\packages\Microsoft.Bcl.Build.1.0.13\
  2. 关闭解决方案
  3. 开放解决方案
  4. 导航到View / Other Windows / Package Manager Console
  5. 按窗口右上角的“ 还原包
  6. 重建

(由于某些原因,其他答案都没有对我有用。)

我通过这样做解决了这个问题:

  1. 删除“packages”文件夹。
  2. 右键单击解决方案> Manage NuGet Packages or Solution
  3. Microsoft.Bcl.Build降级到以前的版本1.0.14。 (写这篇文章的最新稳定版本是1.0.21)
  4. 恢复包并重建。

我刚刚去了特定VS项目的Manage NuGet包选项并更新了Microsoft BCL nuget的版本,它解决了我的问题。

确认您已安装Nuget Package Manager。 默认情况下,Visual Studio 2010没有它(更高版本) – 打开工具/扩展管理器 – 搜索Nuget包管理器并单击下载 – 之后我必须删除Nuget包(Microsoft.Bxl.Async,Microsoft。 BCL和Microsoft.Bcl.Build)导致错误,重新启动VS并重新添加包。

上述答案对我不起作用。 我只需要删除引用(在包和proj文件中)到Microsoft.Bcl.Build ..重建并成功。