如何创建解决方案级别的 NuGet 包? [英] How to create a solution-level NuGet package?

查看:60
本文介绍了如何创建解决方案级别的 NuGet 包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建解决方案级 NuGet 包.也就是说,它不涉及任何项目,并列在 .nuget\packages.config 中(不在任何项目级别的 packages.config 文件中).

How do I create a solution-level NuGet package. That is, one that does not touch any projects, and is listed in .nuget\packages.config (not in any project-level packages.config files).

例如,psake 和 RavenDB.Server 是解决方案级别的 NuGet 包.

For example, psake and RavenDB.Server are solution-level NuGet packages.

我在 .nuspec 文件或 nuget.exe 的文档中找不到任何关于解决方案级软件包的内容.当他们调用 nuget pack 时,我在这两个项目的构建过程中找不到任何特别之处.事实上,我根本找不到关于创建解决方案级包的单一搜索结果.

I can't find anything in the docs for .nuspec files or nuget.exe that says anything about solution-level packages. I can't find anything special in the build processes of those two projects when they call nuget pack. In fact, I can't find a single search result at all about creating solution-level packages.

推荐答案

我找到了 Phil Haack 的简短评论.它来自 CodePlex 上的问题:

I found a brief comment from Phil Haack. It's from an issue on CodePlex:

我们已经支持这一点.只是不要在/Content 中放置任何内容文件夹也不在/Lib 文件夹中.如果您的包裹中只有内容/Tools 文件夹,该包将不会安装在项目中.

We already support this. Just don't put any content in the /Content folder nor in the /Lib folder. If your package only has contents in the /Tools folder, the package will not get installed in the project.

还没有机会对此进行测试,但这听起来像是您要找的.快速浏览一下 RavenDB.Server 包(将 .nupkg 重命名为 .zip)会发现一个与 Phil 在评论中所说的一致的设置.没有内容文件夹,没有 lib 文件夹.很多文件.这些文件不在 /tools 文件夹中,所以我认为可以安全地假设这不是必需的.

Haven't had a chance to test this out, but it sounds like what you're looking for. A quick peek into the RavenDB.Server package (rename .nupkg to .zip) reveals a setup that is consistent with what Phil said in his comment. No content folder, no lib folder. Lots of files. The files are not in a /tools folder, so I think it's safe to presume that's not a requirement.

这篇关于如何创建解决方案级别的 NuGet 包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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