unable to locate nuget.exe

今日使用vs 从github fork 一份代码到本地之后,提示项目 unable to locate nuget.exe。

原因:代码托管时未提交 nuget.exe 或其他原因丢失

解决方法:在解决方案目录下 .nuget 文件夹里面找到 Nuget.targets文件打开;

             找到

<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>

     改成

<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>

然后重新生成项目即可。

  ——————————————————————其他方法——————————————————————————————

参见:http://stackoverflow.com/questions/12022154/prevent-needing-to-add-nuget-exe-to-source-control

原文地址:https://www.cnblogs.com/bninp/p/5453994.html