unable to locate nuget.exe when building webservice on appharbor

隐身守侯 提交于 2019-11-28 17:16:53

问题


I'm trying to deploy my webservice at appharbor using codeplex. After trying it the first time and doing some research I found out that I had to use NuGet so the references are being found..

Now I only have 1 error left which I don't know how to solve

   "D:\temp\g3wyilvx.uln\input\WebService\Webservice.sln" (default target) (1) ->
   "D:\temp\g3wyilvx.uln\input\WebService\Webservice\Webservice.csproj" (default target) (2) ->
   (CheckPrerequisites target) -> 
     D:\temp\g3wyilvx.uln\input\WebService\.nuget\nuget.targets(72,9): error : Unable to locate 'D:\temp\g3wyilvx.uln\input\WebService\.nuget\nuget.exe' [D:\temp\g3wyilvx.uln\input\WebService\Webservice\Webservice.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.17

How am I suppose to solve this error ? Any useful links that might help me in the future are also appreciated.


回答1:


I solved this by changing this line in my NuGet.targets file and setting it to true:

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

But you must restart Visual Studio or reload the solution (see this) for this to take effect.




回答2:


I resolved the problem by right clicking Solution and click

Enable NuGet Package Restore



回答3:


Executables might be ignored in your .gitignore via

*.exe 

Add this line to .gitignore:

!.nuget/NuGet.exe



回答4:


  • Enable NuGet Package Restore

  • Right click on solution then
  • select Enable NuGet Package Restore



回答5:


Here's a blogpost on using NuGet package restore with AppHarbor. In your case, the problem might be that you haven't included the .nuget folder in your repository.




回答6:


I faced this issue, when one of my colleague added a new project in solution. He added new packages from nuget. The above top rated answer was not acceptable for me because once I update nuget packages, it updates all referenced libraries in the project.

How I removed this error, by just removing import statements for nuget package from .csproj files.

To do so, right click on .csproj file, and open it in notepad and remove the statement.



来源:https://stackoverflow.com/questions/13932154/unable-to-locate-nuget-exe-when-building-webservice-on-appharbor

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!