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.
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
).
- SampleExtension
- this is a class library the implements the extension interfaces in ExtensionManager.Core
and is loaded at runtime.
Inside the 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.1 Reply
Source code is here if it helps:
https://github.com/ArchLeaders/ExtensionManager
GitHub
GitHub - ArchLeaders/ExtensionManager: Project to test a runtime-ex...
Project to test a runtime-extension loader. Contribute to ArchLeaders/ExtensionManager development by creating an account on GitHub.