繁体   English   中英

在未安装Visual Studio的计算机上运行nuget.exe

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

我需要从服务器创建一个自定义的Nuget程序包,该程序包将用我的章鱼来执行一些部署。

我已将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。

无论如何,是否可以在未安装Visual Studio的服务器上使NuGet包正常工作?

尝试将nuget安装程序直接下载到服务器

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

而不是复制NuGet.exe可执行文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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