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.

6 Answers 6

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.

3
  • 1
    For anyone who can't find it, the nuget.targets file is in the .nuget/ (usually hidden) subfolder of the project folder.
    – Jeff Hay
    May 17, 2017 at 18:23
  • 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 ;) Nov 16, 2019 at 8:14
  • 1
    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/…
    – Harv
    Feb 10 at 15:27
101

I resolved the problem by right clicking Solution and click

Enable NuGet Package Restore
1
  • 9
    I did'nt find your given option in my visual studio 2012 neither in solution nor in any project. Jan 2, 2014 at 13:13
14

Executables might be ignored in your .gitignore via

*.exe 

Add this line to .gitignore:

!.nuget/NuGet.exe
1
  • That applies to me. Thank you.
    – Blaise
    Oct 16, 2015 at 18:52
3
  • Enable NuGet Package Restore enter image description here
  • Right click on solution then
  • select Enable NuGet Package Restore
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.

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.