0

I'd like to create a .Net project (.Net Framework, not Core) that exists strictly for the sake of composing various other NuGet packages.

I have a plugin-based system where all plugins are NuGet packages and the core-system itself is a NuGet package. The core system is useless without the plugins, it is strictly an engine that knows how to run the plugins. Because I do not want to include references to plugins in my core system, I need an entirely separate project which is the composition of both the core system package and the plugins I'd like to use. I'm calling this my "composition" project where I am "composing" all the elements together prior to deploying to our server.

Example of existing projects / packages:

  • Core System (NuGet package... should not directly reference plugins)
  • Plugins
    • Plugin 1 (NuGet package)
    • Plugin 2 (NuGet package)
    • Etc. (NuGet package)

Hypothetical "composition" project:

  • Composition Project
    • Reference -> Core System
    • Reference -> Plugin 1
    • Reference -> Plugin 2

Is there a way to have a project that is nothing more than references to NuGet packages but does not produce its own assembly? Perhaps this could be done with MSBuild trickery.

Ryan Griffith
  • 1,591
  • 17
  • 41
  • [NuProj](http://nuproj.net/documentation/) or [NuGetizer](https://github.com/NuGet/Home/wiki/NuGetizer-3000) might be something worth looking at. You should be able to create a composition project and build a meta-package using either of these tools. – Matt Ward Jan 02 '19 at 18:31
  • @MattWard How would this be done on .NET Core or .NET Standard? Also, the NuProj repo has been archived by its' owner; NuGetizer [doesn't seem to support VS 2019](https://github.com/NuGet/Home/issues/7967). NB The NuGetizer link is to the overview docs; the actual project appears to be [here](https://github.com/NuGet/NuGet.Build.Packaging). – Zev Spitz Dec 18 '19 at 06:26
  • Not sure you can create a meta-package with the standard dotnet pack. You may have to create a .nuspec that just has the NuGet package dependencies and no content, then use `nuget pack Your.nuspec`. – Matt Ward Dec 18 '19 at 14:27

1 Answers1

1

I don't know of a way that just pulls down nuget packages with an assembly to be attached to.

But that's ok though. We have also done this here at our company. We have a solution and one .csproj file that brings in all the nuget packages that everything (Hundreds of other projects) needs. And of course it produces an associated .DLL. But that is ok, just have a post build step that deletes it.

C.J.
  • 15,637
  • 9
  • 61
  • 77