0

I am looking for a way to create a single NuGet package from different projects.

For example, I have ProjectA and ProjectB, one contains interfaces and the other contains the implementation. Now I want to create a NuGet project (with the name PackageA) that contains the source code of both the projects I-e ProjectA and ProjectB.

Note, I figure out a way to create a package that is also shipped with the depended .dlls, however now I am looking for a way to create only one package (no depended .dlls).

Kind Regards

Ustad
  • 71
  • 5
  • It is pretty uncommon for nupkg packages to contain *source code* - did you actually mean that? The actual packaging step is a bit messy, but you can bundle additional files via the csproj - the trick is getting them to the right locations (or you can pack it manually, for example https://stackoverflow.com/questions/16173568/build-nuget-package-automatically-including-referenced-dependencies) - but honestly: I wonder if you're over-thinking this. What is the actual problem you're trying to solve? If ProjectA and ProjectB are both always needed: *why is it two projects to start with*? And (1/2) – Marc Gravell Apr 19 '22 at 08:29
  • 1
    (2/2) if you *want* to keep them separate, what is the problem with having two nupkg packages with the usual package dependency between them? – Marc Gravell Apr 19 '22 at 08:30
  • I wanted to create different projects just from a readability and maintainability perspective. In the end, the consumer of my Nuget package should not be aware of how many DLLs its is consist of. – Ustad Apr 19 '22 at 09:33

0 Answers0