[英]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. 我需要从服务器创建一个自定义的Nuget程序包,该程序包将用我的章鱼来执行一些部署。
I have copied the NuGet.exe executable to the server, and I attempt to do the following command there: 我已将NuGet.exe可执行文件复制到服务器,然后尝试在该服务器上执行以下命令:
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. 这仅应在本地计算机上获取一些文件,然后将它们打包到一个nupkg文件中。 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. 我尝试将
'EnableNuGetPackageRestore'
设置为'true'
,但无济于事。
Of course I can't check anything in Package Manager node in Visual Studio, since VS is not installed on my server. 当然,我无法在Visual Studio的“程序包管理器”节点中检查任何内容,因为服务器上未安装VS。
Are there anyway to get the NuGet pack to work on my server without Visual Studio installed on it? 无论如何,是否可以在未安装Visual Studio的服务器上使NuGet包正常工作?
Try direct download the nuget installer to the server 尝试将nuget安装程序直接下载到服务器
http://docs.nuget.org/docs/start-here/installing-nuget http://docs.nuget.org/docs/start-here/installing-nuget
instead of copying the NuGet.exe executable file. 而不是复制NuGet.exe可执行文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.