I'm developing an application with plugins. I have a separate API assembly with all the API interfaces.
The main application dynamically loads the plugins from dlls:
object pi = Assembly.LoadFrom(plugin.AssemblyPath)
.CreateInstance(plugin.ClassName);
and then i'm casting it to the actual plugin type:
IPlugin pluginInstance = (IPlugin)pi;
All of this is working fine when none of the assemblies are signed. As soon as i sign them (main app, API assemply and the plugin assemply) it fails to cast, throwing:
Unable to cast object of type '.MyPlugin' to type '.IPlugin'.
Any suggestions?