What I have now (which successfully loads the plug-in) is this:
Assembly myDLL = Assembly.LoadFrom('my.dll'); IMyClass myPluginObject = myDLL.CreateInstance('MyCorp.IMyClass') as IMyClass;
This only works for a class that has a constructor with no arguments. How do I pass in an argument to a constructor?
You cannot. Instead use Activator.CreateInstance as shown in the example below (note that the Client namespace is in one DLL and the Host in another. Both must be found in the same directory for code to work.)
However, if you want to create a truly pluggable interface, I suggest you use an Initialize method that take the given parameters in your interface, instead of relying on constructors. That way you can just demand that the plugin class implement your interface, instead of ‘hoping’ that it accepts the accepted parameters in the constructor.