question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It is not possible to pack multiple projects into one NuGet package

See original GitHub issue

Steps to reproduce

Using VS 2017 and new .csproj format

  1. Create CommonLib.csproj project, it should not be published as NuGet package.
  2. Create ProjectA.csproj project, it should be published as NuGet package.
  3. Add project reference from ProjectA to CommonLib.
  4. Pack the ProjectA (with Visual Studio or CLI).

Expected behavior

ProjectA.nupkg is created. It contains ProjectA.dll and CommonLib.dll.

Actual behavior

ProjectA.nupkg is created. It contains only ProjectA.dll. CommonLib is added as a NuGet dependency.

Additional info

I have tried to add <IsPackable>false</IsPackable> property to the CommonLib.csproj, but it is not take into the consideration.

Environment data

dotnet --info output: NET Command Line Tools (1.0.1)

Product Information: Version: 1.0.1 Commit SHA-1 hash: 005db40cd1

Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\1.0.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

43reactions
Patrickkkcommented, Jun 2, 2017

While it would probably be nice to have (especially for legacy stuff). Isn’t it a bit strange that there are 2 projects when it is distributed as 1 package? Unless there are some external factors into play forcing you to separate shouldn’t it simply be 1 project since it is distributed as 1 package?

14reactions
auduchinokcommented, Sep 25, 2017

@Patrickkk, although the issue is closed, I wanted to provide an example scenario when multiple projects are needed. We use C# and F# together in a single solution, half of the projects are written in each language.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating one NuGet package from multiple projects in ...
If you have more than one project in VS and your Pack file is dependant on another project then both need to be...
Read more >
It is not possible to pack multiple projects into one NuGet ...
Yes, that is definitely possible to just merge the two projects together, and this is a workaround that I will use. But I...
Read more >
Nugget package of multiple projects? : r/dotnet
I wrote an for my company that I separated into multiple projects (data access, business logic, and a service layer).
Read more >
Producing Multiple Related NuGet Packages from a Single ...
Just create a couple of class libraries, add project references between them, and when you run dotnet pack , it just does the...
Read more >
[Solved]-Creating one NuGet package from multiple projects ...
If you have more than one project in VS and your Pack file is dependant on another project then both need to be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found