Loading an assembly at runtime
-
Hi, I´m trying to load an assembly at runtime with:
ObjectHandle plugin = System.Activator.CreateInstanceFrom(@"C:\PathToDll\MyDll.dll", "PluginClass");
But this returns a strange error: Exception has been thrown by the target of an invocation. "The targetNamespace parameter 'MyDll' should be the same value as the targetNamespace 'urn:MyDll' of the schema." ok, where does a schema come into the picture? All help would be appreciated. -
Hi, I´m trying to load an assembly at runtime with:
ObjectHandle plugin = System.Activator.CreateInstanceFrom(@"C:\PathToDll\MyDll.dll", "PluginClass");
But this returns a strange error: Exception has been thrown by the target of an invocation. "The targetNamespace parameter 'MyDll' should be the same value as the targetNamespace 'urn:MyDll' of the schema." ok, where does a schema come into the picture? All help would be appreciated. -
I think that would imply that you need to specify the namespace in the class type field and it should match the DLL name, so try:
ObjectHandle plugin = System.Activator.CreateInstanceFrom(@"C:\PathToDll\MyDll.dll", "MyDll.PluginClass");
Hope that helps!