根据The NuGet docs,我希望能够在 packages.config 中安装所有 NuGet 包。NuGet 安装为 VS 扩展,我似乎找不到 nuget.exe。是否可以运行:
nuget i packages.config -o 包
没有在每个项目的基础上维护单独的 nuget.exe 副本?
根据The NuGet docs,我希望能够在 packages.config 中安装所有 NuGet 包。NuGet 安装为 VS 扩展,我似乎找不到 nuget.exe。是否可以运行:
nuget i packages.config -o 包
没有在每个项目的基础上维护单独的 nuget.exe 副本?
警告- 使用
Update-Package -Reinstall
或者
Update-Package -Reinstall -IgnoreDependencies
可能会删除您所有的包和 package.config 文件!
始终确保首先执行备份。
场景:
Update-Package -Reinstall
,或者如果您有一些 alpha 包和/或确定您的依赖项是好的,请尝试Update-Package -Reinstall -IgnoreDependencies
结果:
由于 packages 文件夹不存在,因此您的包的条目也会有条不紊地消失。这可能会让一些人感到惊讶——所以要小心,这就是我要说的。
作为这篇文章的更新,NuGet 1.6 添加了对工作流的支持,以在构建时恢复包(如果丢失)。右键单击解决方案,单击“启用包还原模式”将其设置为开启。
更多详细信息,请访问: http ://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages
Found the solution on This blog entry. I needed to install NuGet.CommandLine, which makes nuget.exe. globally available in the VS command line. I can then set this up as a pre-build event to ensure that dependencies are downloaded.