简体   繁体   中英

Running nuget.exe on a machine where Visual Studio is not installed

I have a need to create a custom Nuget package from my server that will be used my Octopus to perform some deployment.

I have copied the NuGet.exe executable to the server, and I attempt to do the following command there:

nuget.exe pack translations.nuspec -NonInteractive

This is only supposed to take some files on the local machine, and pack them into a nupkg file. This works as expected on my machine.

On the server I get the following message:

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'.

I have tried setting 'EnableNuGetPackageRestore' to 'true' , but to no avail.

Of course I can't check anything in Package Manager node in Visual Studio, since VS is not installed on my server.

Are there anyway to get the NuGet pack to work on my server without Visual Studio installed on it?

Try direct download the nuget installer to the server

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

instead of copying the NuGet.exe executable file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM