我在 Visual Studio 2012 中安装了 NuGet 2.1.31002.9028。当我启用包还原并将任何包(如 EntityFramework)添加到我的项目时,在构建项目时出现以下错误:
Error 1 The system cannot find the path specified. ConsoleApplication1
Error 2 The command ""D:\Code\ConsoleApplication1\.nuget\nuget.exe" install "D:\Code\ConsoleApplication1\ConsoleApplication1\packages.config" -source "" -RequireConsent -solutionDir "D:\Code\ConsoleApplication1\ "" exited with code -1. ConsoleApplication1
Warning 3 The referenced component 'System' could not be found. ConsoleApplication1
对于每个参考,都有一个类似上面的警告。当我从命令提示符运行它时,第二个错误中的命令工作正常。我检查了“允许 NuGet 在构建期间下载丢失的包”,我还尝试添加一个 EnableNuGetPackageRestore 环境变量,但都没有解决问题。我也没有在我的另一台机器上遇到这个问题,这使得它更加混乱。
感谢您对此提供的任何帮助,并且非常乐意在需要时提供任何其他信息。