Dynamically Loaded Libraries in ServerCore

Dynamically loaded libraries have to be placed in the root folder of the application. Alas contrary to previous version this doesn’t have to be sufficient. If the dynamically loaded library has its own dependencies, that are not included in the ServerCore, they have to be added to configuration file Origam.ServerCore.deps.json. On the other hand the loaded library doesn’t have to be included there.

For example let’s have a project that contains a custom library CustomServiceLibrary.dll, that is used as a workflow service and serves as a wrapper for WrappedLibrary.dll. As described before to be able to use CustomServiceLibrary.dll we need to add WrappedLibrary.dll to configuration file Origam.ServerCore.deps.json.

First we need to add WrappedLibrary.dll to libraries section:

"WrappedLibrary/1.0.0.0": {
    "type": "reference",
    "serviceable": false,
    "sha512": ""
}

And then we need to add an entry to targets -> .NETCoreApp,Version=v3.1:

"WrappedLibrary/1.0.0.0": {
    "runtime": {
        "WrappedLibrary.dll": {
            "assemblyVersion": "1.0.0.0",
            "fileVersion": "1.0.0.0"
        }
    }
}