为什么nuget打包时不包含引用的项目? [英] Why doesn't nuget include the referenced project when packing?

查看:22
本文介绍了为什么nuget打包时不包含引用的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面的简单场景中重现了这个问题

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 of nuget.exe from nuget.org/nuget.exe or by nuget update -self.

    这篇关于为什么nuget打包时不包含引用的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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