External Module Discovery¶
The Suite Framework provide a mechanism to discover modules at runtime from a defined folder in the deployment folder structure, these modules are called External Modules.
This mechanism allows us to add new functionality, and/or change contracts implementation by only deploying the modules, along with their dependencies and required assets, to a specific folder in the deployment.
Discovery¶
The folder in which the Suite Framework expects to found modules at runtime is
named modules
and it is located at the same level of the application's
executing path; that is usually next to your application's .dll
.
External Modules Dependencies¶
It is important to mention that each module can have its own dependencies. In
this context, by dependencies we mean Nuget Packages, or .dlls
that the
Assembly where an External Module, meaning the assembly containing the
ISuiteModule
implementation is found has.
The framework will load the module assemblies along with their dependencies in
an almost isolated AssemblyLoadContext
. An exception is made for
dependencies that are already present in the main application's load context.
Meaning that, if the application already depends on Package A version 3, and an
external module depends on Package A version 2, Package A version 3 will be used
instead.
This mechanism enforces the usage of those dependencies already provided by the framework to be preserved over those provided by the plugins. Therefore if your plugin have dependencies which were not loaded before by the hosting application, there will not be any replacement or intervention of loading from the plugin context.
Important
Only those assemblies not loaded before by the hosting application will be loaded from the plugin context. Any dependency loaded in a plugin loading context will live side-by-side with other plugin's dependencies, because of the plugin dependency isolation.
Deployment of external modules¶
Each module should be deployed in a separate folder. This is so that modules can have it's own isolated dependencies.
Text Only | |
---|---|
When deploying external modules, we recommend to build them at the same time of the application. It is not a requirement, but guarantees that at runtime the application will have all it's dependencies and correct versions.