The contract assemblies do not depend on any NuGet packages. Just .NET framework assemblies. Unlike a web application though plugins to our application are hosted by our shell exe. This means that if our shell exe references a nuget package like Automapper
and a module developer later nugets in an incompatible version of automapper their plugin cannot be hosted in our shell exe anymore. Granted the fix is for the module developer to go back and ref a compatible version of automapper but its these kinds of version
conflicts that nuget is intended to take care of.
Here's an example:
MyApp NuGet Package
References only .NET framework
Packaged in lib folder of NuGet package so that plugins get a reference to it
Packaged in tools folder with MyApp.exe so that it can be executed as the startup app for modules developers.
Has project reference to MyApp.Contracts
References Prism, Automapper and Moq NuGet packages.
Packaged in tools folder with myapp.contracts.dll, automapper.dll and moq.dll.
Init.ps1 adds a command to the package manager console so that a module developer can Update-DebuggerSettings. This sets the debugger to launch MyApp.EXE from the tools folder and passes a command line parameter to the module's
build output folder to load the module as a plugin at runtime.
References MyApp NuGet package
Runs Update-DebuggerSettings command added by nuget package which sets MyApp.exe as the startup app for this project
If I reference an incompatible version of Automapper in this project I will break MyApp.exe. This is where I would like to have the MyApp NuGet package declare that it uses Automapper version x.y.z and only allow the MyModulePlugin
project to reference that version of Automapper. NOTE: it should also set the reference to automapper as copy local false since the assembly will be part of the main application's bin folder.