unable to locate nuget.exe when building webservice on appharbor

Appharbor

Appharbor Problem Overview


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.

Appharbor Solutions


Solution 1 - Appharbor

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.

Solution 2 - Appharbor

I resolved the problem by right clicking Solution and click

Enable NuGet Package Restore

Solution 3 - Appharbor

Executables might be ignored in your .gitignore via

*.exe 

Add this line to .gitignore:

!.nuget/NuGet.exe

Solution 4 - Appharbor

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.

Solution 5 - Appharbor

  • Enable NuGet Package Restore enter image description here
  • Right click on solution then
  • select Enable NuGet Package Restore

Solution 6 - Appharbor

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.

Categories
Recommended Appharbor Solutions

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1456158View Question on Stackoverflow
Solution 1 - AppharbormcdrummermanView Answer on Stackoverflow
Solution 2 - AppharborBraveNewMathView Answer on Stackoverflow
Solution 3 - AppharborPeter GfaderView Answer on Stackoverflow
Solution 4 - AppharborfriismView Answer on Stackoverflow
Solution 5 - AppharborMohammad FarahaniView Answer on Stackoverflow
Solution 6 - AppharborLaliView Answer on Stackoverflow