Visual Studio 2013 引入了无需 MSBuild 的包还原的新方法,启用 NuGet 包还原的旧方法是 deprecated现在。
迁移项目后,如 Nuget docs 中所述,
在 VisualStudio 中构建时,包恢复工作,但当使用命令行 VisulStudio 和事件运行构建时 vcvarsall.bat 包没有恢复。
我错过了什么吗?
结论
好吧,如果您从命令行调用 Visual Studio,则不会调用包还原。使用手动包还原 nuget.exe
nuget restore Solution.sln
For this particular line to work you'll need to install NuGet system wide and add path to it's binaries folder into
PATH
environment variable
最佳答案
在命令行上,您必须手动运行 Nuget restore solution.sln
在调用之前 msbuild.exe
.这只是构建运行前的一小步。
Visual Studio 会自动执行此操作并调用 nuget restore
也由 Team Build 作为工作流程的一部分执行。
关于.net - Visual Studio 2013 NuGet 包还原在命令行中不起作用(不是 msbuild,而是 vcvarsall.bat),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30923226/