title: Creating instances from strings over different namespaces and different assemblies
body: <p>I am making a component based system (each object delegates all functionality to a variety of components which can be added at runtime) and want to be able to define my objects in XML files for ease. I know how to use <code>Activator.CreateInstance</code> to create my objects from strings, but I require full classnames and assembly names.</p>
  
  <p>The issue comes from the fact that these components may be either pre-built in my library (say assembly <code>FirstAssembly.dll</code> and namespace <code>Foo.Bar</code>) or defined specifically for my game (say assembly <code>SecondAssembly.dll</code> and namespace <code>Second.Blah</code>). </p>
  
  <pre><code>//In some assembly FirstAssembly.dll
  
  namespace Foo.Bar
  {
  class SomeClassA
  {
  }
  
  class SomeClassB
  {
  }
  }
  
  //In some assembly SecondAssembly.dll
  
  namespace Second.Blah
  {
  class SomeClassC
  {
  }
  
  class SomeClassD
  {
  }
  }
  
  //In my XML..I would much prefer
  &lt;class="SomeClassA"...&gt; &lt;/class&gt;
  &lt;class="SomeClassD"...&gt; &lt;/class&gt;
  
  //Over this, which would just need to check FirstAssembly and SecondAssembly and error handle
  &lt;class="Foo.Bar.SomeClassB"...&gt;&lt;/class&gt;
  &lt;class="Second.Blah.SomeClassD"...&gt;&lt;/class&gt;
  
  //Which I would much prefer over
  &lt;class="Foo.Bar.SomeClassB" assembly="FirstAssembly"...&gt;&lt;/class&gt;
  &lt;class="Second.Blah.SomeClassD" assembly="SecondAssembly"...&gt;&lt;/class&gt;
  </code></pre>
  
  <p>The last solution would be easy, if rather annoying - I need assembly names, or at least some way of saying 'component from library' or 'component from game'.</p>
  
  <p>The second solution is probably easier - I just need (some way) of checking - probably just <code>try/catch</code> - if the class is in FirstAssembly; if not, try SecondAssembly.</p>
  
  <p>The first solution is what I really want to do, but I do not think it possible. The amount of namespaces would make it difficult.</p>
  
  <p>tl;dr Is there a way I can make this system work so my XML files look as close to the first solution as possible? If not, is the second solution viable?</p>