unable to locate nuget.exe when building webservice on appharbor
Asked Answered
T

6

90

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.

Tudor answered 18/12, 2012 at 11:40 Comment(0)
D
212

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.

Distrait answered 10/12, 2013 at 18:7 Comment(3)
For anyone who can't find it, the nuget.targets file is in the .nuget/ (usually hidden) subfolder of the project folder.Misappropriate
Thank you man. I have changed NuGet.targets as setting to tag "DownloadNuGetExe" to "true" but didn't restart VS and continue to get the error(s). So after restarting Visual Studio and rebuild solution everything is OK. Again - thanks ;)Hersh
This is a workable solution if you want to keep using nuget.targets, but you can also just migrate away from this method of doing package restore and that's generally better. learn.microsoft.com/en-us/nuget/consume-packages/…Bales
T
101

I resolved the problem by right clicking Solution and click

Enable NuGet Package Restore
Thalia answered 29/8, 2013 at 17:11 Comment(1)
I did'nt find your given option in my visual studio 2012 neither in solution nor in any project.Depression
C
14

Executables might be ignored in your .gitignore via

*.exe 

Add this line to .gitignore:

!.nuget/NuGet.exe
Cetus answered 25/3, 2013 at 21:59 Comment(0)
S
3

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.

Samarium answered 18/12, 2012 at 23:10 Comment(0)
A
3
  • Enable NuGet Package Restore enter image description here
  • Right click on solution then
  • select Enable NuGet Package Restore
Aryan answered 13/10, 2015 at 13:23 Comment(0)
G
0

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.

Gram answered 12/3, 2018 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.