Building a Plugin system with Castle Windsor, I am relying on the
IWindsorContainer.Register(Classes.FromAssemblyInDirectory(...).BasedOn(IMyInterface))
Function.
My Main App (into which components should be plugged in) references Castle Windsor 5.0.1 via NuGet.
One Plugin-Assembly that implements IMyInterface
also references Castle Windsor 5.0.1 directly, plus another NuGet Package, that itself requires Castle Windsor 4.0.0 (or higher).
When I now try to resolve a IMyInterface object from the container I get a Castle.MicroKernel.ComponentActivator.ComponentActivatorException:
ComponentActivator: could not instantiate MyInterfaceImplementaionClass
, with the second inner exception telling me: FileLoadException: Could not load file or assembly 'Castle.Windsor, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
As I have no (direct) control over what assemblies are referenced by some NuGet-Packages I have no idea how to resolve this problem.
If I refernce the Plugin-Assembly directly in my Main App, everything works as expected -- but then the plugin is obviously no longer a plugin but a build-in dependency of my Main App which is not what I want...
Can anybody tell me how to resolve this problem ?
User contributions licensed under CC BY-SA 3.0