为什么nuget打包时不包含引用的项目? [英] Why doesn't nuget include the referenced project when packing?
问题描述
我在下面的简单场景中重现了这个问题
I have reproduced this issue in the following simple scenario
- LibB - 项目
- B 类
- 引用 ClassB 的 ClassA
现在我想创建一个
LibA
的 nuget 包并运行:Now I want to create a nuget package of
LibA
and run:nuget pack LibA.csproj
这工作正常,但是当我检查 nuget 包时,我无法在 lib 文件夹中找到我预期的
LibB.dll
.为什么不呢?This works fine, but when I check the nuget package I can't find a
LibB.dll
in the lib folders as I expected. Why not?我使用的是 Nuget 2.2 版.
I'm using version 2.2 of Nuget.
推荐答案
NuGet 2.5 现在有一个
-includereferencedprojects
选项,更多细节可以在这里找到:NuGet 命令行界面 (CLI) 参考 |微软文档
我从nuget.org/nuget.exe
或通过nuget update -self
下载最新版本的nuget.exe
.NuGet 2.5 now has a
-includereferencedprojects
option, more details can be found here : NuGet Command-Line Interface (CLI) Reference | Microsoft Docs
I download the latest version ofnuget.exe
fromnuget.org/nuget.exe
or bynuget update -self
.这篇关于为什么nuget打包时不包含引用的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!