问题
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.
回答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.
来源:https://stackoverflow.com/questions/54011001/create-a-net-project-strictly-for-composition-of-nuget-packages