2014-02-10 37 views
0

我需要從我的服務器創建一個定製的Nuget包,該包將用於我的八達通執行一些部署。在未安裝Visual Studio的機器上運行nuget.exe

我抄NuGet.exe可執行文件到服務器,我試圖做下面的命令有:

nuget.exe pack translations.nuspec -NonInteractive 

這只是應該採取在本地機器上的一些文件,並把它們包成一個nupkg文件。這在我的機器上按預期工作。

在我收到以下消息的服務器:

Package restore is disabled by default. To give consent, open the Visual Studio 
Options dialog, click on Package Manager node and check 'Allow NuGet to download 
missing packages during build.' You can also give consent by setting the 
environment variable 'EnableNuGetPackageRestore' to 'true'. 

我已經嘗試設置'EnableNuGetPackageRestore''true',但無濟於事。

當然,我無法檢查Visual Studio中包管理器節點中的任何內容,因爲VS未安裝在我的服務器上。

有沒有辦法讓NuGet包在我的服務器上工作而沒有安裝Visual Studio?

回答

1

嘗試直接下載的的NuGet安裝到服務器

http://docs.nuget.org/docs/start-here/installing-nuget

,而不是複製NuGet.exe可執行文件。

+0

那麼下載的nuget.exe和安裝的擴展名不一樣嗎? – stijn

+0

這真的有竅門。我不知道他們是不一樣的。謝謝! –

相關問題