I've implemented a plugin system in .NET. The base library implements basic classes and interfaces exposed to plugins, the plugin libraries links the base library for using exposed classes and interfaces.
The problem I'm facing is that a (simple) recompilation of the base library (with or without modifications) cause the plugins not able to being loaded, giving the exception message:
"Could not load file or assembly 'BaseLibrary, Version=0.0.1.68, Culture=neutral, PublicKeyToken=7b445b12e635292c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
This problem is solved by compiling all at once the base library and the plugin libraries, but this is not very comfortable during development, since I modify base library quite frequently in this phase.
If there any method to "relax" binary matching?
Is it possible that the base library assembly information (quoted below) could be the casue of the problem?
[assembly: AssemblyVersion("0.0.1.*")]
I forgot to mention that assemblies are signed.
Assemblies are loaded using the following routine
Assembly hLibrary = Assembly.LoadFile(pPath);
Type plugImageCodecFactoryType = hLibrary.GetType("Derm.ImageCodecPluginFactory", true, false);
object plugImageCodecFactory = Activator.CreateInstance(plugImageCodecFactoryType);
object plugInstance;
MethodInfo plugFactoryCreate = plugImageCodecFactoryType.GetMethod("CreatePlugin", BindingFlags.Instance|BindingFlags.Public);
plugInstance = plugFactoryCreate.Invoke(plugImageCodecFactory, null);
if (plugInstance is IImageCodecPlugin)
RegisterPlugin((IImageCodecPlugin)plugInstance);