使用包还原时,有没有办法自动更新 .nuget 文件夹中的 nuget.exe? [英] Is there a way to automatically update nuget.exe in the .nuget folder when using package restore?

查看:19
本文介绍了使用包还原时,有没有办法自动更新 .nuget 文件夹中的 nuget.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自 Nuget 1.5 以来,我的团队一直在使用启用包还原选项来使包不受我们的源代码控制.当 Nuget 1.6 发布时,我们注意到一个问题,即它没有将包拉下来,并将其追踪到 .nuget 文件夹中的 Nuget.exe,需要更新到 1.6 以匹配包管理器.

My team has been using the Enable Package Restore option since Nuget 1.5 to keep packages out of our source control. When Nuget 1.6 was released we noticed an issue where it wasn't pulling the packages down, and tracked it down to the Nuget.exe in the .nuget folder needed to updated to 1.6 to match the Package Manager.

更新 Nuget 后,更新解决方案的最佳方式是什么?我没有从工作室看到一个简单的方法来判断解决方案文件夹中的 nuget 版本.到目前为止,我们清除了 .nuget 文件夹并重新运行 Enable Package Restore 命令.

What's the best way to update a solution once Nuget has been udpated? I don't see an easy way from studio to tell which version of nuget is in the solution folder. So far we blow away the .nuget folder and re-run the Enable Package Restore command.

推荐答案

我建议从命令行使用以下命令更新 .nuget uget.exe:

I would suggest updating .nuget uget.exe with this command from the command line:

nuget.exe update -self

:首先关闭 VS 解决方案.如果有更新并打开解决方案,则将从解决方案中删除 nuget.exe.

: Close VS Solution first. If there's an update and the solution is opened, nuget.exe will be removed from the solution.

可以通过修改 .nuget uget.targets 以添加上述命令,在还原时自动更新 nuget.exe.我将以那里的恢复命令为例.但我不确定这是否值得,nuget.exe 更新并不常见,而且向后兼容性应该很少中断.

You could automatically update nuget.exe on restore by modifying the .nuget uget.targets to add the above command. I'd look at the restore command in there as an example. But I'm not sure if it's worth it, nuget.exe updates aren't that common, and backward compatibility should break very rarely.

这篇关于使用包还原时,有没有办法自动更新 .nuget 文件夹中的 nuget.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆