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

cod*_*rid 29 c# asp.net-mvc-4 razor-2

我用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 <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.   BargainMaster.Web
Run Code Online (Sandbox Code Playgroud)

Mil*_*ros 41

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

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

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


A-S*_*ani 6

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

我这样做可以解决此问题:

  1. 删除“程序包”文件夹。
  2. 右键单击解决方案> Manage NuGet Packages or Solution
  3. 降级Microsoft.Bcl.Build到以前的版本1.0.14。(在撰写本文时,最新的稳定版本是1.0.21)
  4. 还原软件包并重建。

  • 使用 VS2019,我的解决方案类似:将 Microsoft.Bcl.Build 降级到 1.0.14,构建 [成功!],升级回 1.0.21 并再次构建 [也成功!]。 (2认同)