2012-12-18 64 views
75

我試圖在使用codeplex的appharbor上部署webservice。 試圖在第一次和做一些研究,我發現,我原來用的NuGet這樣被發現後引用..在appharbor上構建webservice時無法找到nuget.exe

現在我只留下1個錯誤,我不知道如何解決

"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 

我想如何解決這個錯誤? 任何有用的鏈接,可能會幫助我在未來也感激。

回答

14

可執行文件可能會在你的.gitignore通過

*.exe 

忽視添加此行的.gitignore:

!.nuget/NuGet.exe 
+0

這適用於我。謝謝。 – Blaise

99

我通過右鍵單擊解決方案解決了這個問題,並單擊

Enable NuGet Package Restore 
+9

在解決方案和任何項目中,我都沒有在Visual Studio 2012中找到您的選擇。 – UMAR

161

我通過在我的NuGet.targets文件中更改此行並將其設置爲true來解決此問題:

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

必須重新啓動Visual Studio或刷新此生效的解決方案see this)。

+8

哦,你是偉大的人,浪費了2個小時終於你的解決方案爲我工作愛你:) – UMAR

+3

非常感謝你 - 我喜歡SO – adaam

+3

感謝這個人。這個錯誤是如此令人討厭... –

3
  • 啓用NuGet包還原 enter image description here
  • 的解決方案右鍵單擊,然後
  • 選擇啓用NuGet包還原
相關問題