I am continuing on from a previous question relating to loading instances of plugins specified in the app.config.
I'm curious if it's possible to add a plugin without requiring a reference added to my project and if so, how do I go about that?
<configuration>
<appSettings>
<add key="Plugin" value="Prototypes.BensPlugin, PrototypePlugins" />
</appSettings>
</configuration>
So now I want to load my plugin using:
string tn = /* Retrieve from config */
Type t = Type.GetType(tn);
IPlugin plugin = (IPlugin)Activator.CreateInstance(t);
Given the nature of a plugin, I'm thinking that my assembly shouldn't require a reference to it. It seems like Type.GetType() requires that the plugin assembly is in the reference list (or the GAC?) which leads me to believe that this is not the right approach to plugging in features.
Is this possible or am I looking in the wrong direction?