title: How to dynamically create generic C# object using reflection?
body: <p>In C# I have the following object:</p>
  
  <pre><code>public class Item
  { }
  
  public class Task&lt;T&gt;
  { }
  
  public class TaskA&lt;T&gt; : Task&lt;T&gt;
  { }
  
  public class TaskB&lt;T&gt; : Task&lt;T&gt;
  { }
  </code></pre>
  
  <p>I want to dynamically create TaskA or TaskB using C# reflection (<strong>Activator.CreateInstance</strong>). However I wouldn't know the type before hand, so I need to dynamically create TaskA based on string like "namespace.TaskA" or "namespace.TaskAB".</p>