nuget.exe安装未更新packages.config(或.csproj的)? [英] nuget.exe install not updating packages.config (or .csproj)?

查看:339
本文介绍了nuget.exe安装未更新packages.config(或.csproj的)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

虽然试图获得的NuGet构建工作流在Linux /单的工作,我注意到一个奇怪的事情。

While trying to get a nuget build workflow working on Linux/mono, I've noticed an odd thing.

作为在Linux上,我不能使用的NuGet的Visual Studio插件或PowerShell控制台,但我有nuget.exe命令行实用程序。这个工具有一个安装命令,它正确地取包裹,并将其放置在我的包目录。

Being on Linux, I cannot use the nuget Visual Studio plugin or the Powershell console, but I have the nuget.exe command-line utility. This utility has an "install" command which properly fetches packages and places them in my packages directory.

不过,nuget.exe的安装(而不是在Visual Studio安装)似乎没有更新它补充包packages.config,也没有项目引用添加到我的.csproj。后者是那么重要(我可以做手工),因为packages.config需要包含递归的依赖关系以及我不能做手工......

However, nuget.exe's install (as opposed to the Visual Studio install) doesn't appear to update packages.config with the packages it added, nor does it add project references to my .csproj. The latter is less important (I can do it manually), since the packages.config needs to contain recursive dependencies as well I can't do it manually...

有任何人试图安装新包单独使用nuget.exe或有任何洞察到这一点?我是完全找错了树?

Has anyone else tried to install new packages solely using nuget.exe or has any insight into this? Am I barking up the wrong tree entirely?

推荐答案

由于目前(2.8.1的NuGet)的缩写,这仍然是不可能的和的NuGet命令行客户端的一大缺憾,因为我看到了。

As it currently (Nuget 2.8.1) stands, this is still not possible and a major shortcoming of the nuget command line client, as I see it.

Nuget.exe必须能够安装一个包,并把它添加到 packages.config 与所有依赖是任何东西比最简单的情况下更加有用。

Nuget.exe must be able to install a package and add it to the packages.config with all dependencies to be usable for anything more than the most simple cases.

我已经创建了一个问题,请参阅的https:/ /nuget.codeplex.com/workitem/4258

I have created an issue, see https://nuget.codeplex.com/workitem/4258

有关目前,以下的方法可以使用。请注意,这是很不理想,但至少可以让您使用的NuGet和正确解析依赖的软件包。

For the time being, the following approach can be used. Note that it is far from optimal, but at least enables you to use nuget and resolve dependent packages correctly.


  1. 度假村来管理在 packages.config 手动。添加你需要的软件包,但省略它们的依赖。请注意,这是从普通 packages.config 文件,这的确列出的依赖关系为好。

  1. Resort to managing the packages.config manually. Add the packages you need, but omit their dependencies. Note that this is different from "ordinary" packages.config files, which do list the dependencies as well.

使用脚本来走 packages.config 并出具的NuGet安装<包ID> -Version<&版GT; 每个软件包。这将安装包及其依赖关系。

Use a script to walk the packages.config and issue a nuget install <package-id> -Version <version> for each package. This will install the package and its dependencies.

这篇关于nuget.exe安装未更新packages.config(或.csproj的)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆