Load DLL at runtime with shared dependency
Hello,
I'm currently attempting to make an extension loader for my application, however I'm having issues loading the assembly at runtime because a dependency is already loaded in the running assembly.
Is there a way to tell the SampleExtension DLL to use the loaded
I'm fairly new to this sort of thing, so any help is appreciated.
I'm currently attempting to make an extension loader for my application, however I'm having issues loading the assembly at runtime because a dependency is already loaded in the running assembly.
This is my current setup:
ExtensionManager.Core- this is a class library that contains the interfaces for the extension and service manager class.
ExtensionManager- this is a CLI project that loads the extension DLL and registers it to a common interface (from
ExtensionManager.Core).
- this is a CLI project that loads the extension DLL and registers it to a common interface (from
SampleExtension- this is a class library the implements the extension interfaces in
ExtensionManager.Coreand is loaded at runtime.
- this is a class library the implements the extension interfaces in
ExtensionManager I attempt to load the SampleExtension.dll and get the type that implements IServiceExtension from ExtensionManager.Core, however doing so throws the following exception:Is there a way to tell the SampleExtension DLL to use the loaded
ExtensionManager.Core instead of loading a new one?I'm fairly new to this sort of thing, so any help is appreciated.