How to instantiate a generic type object in C#?
<p>I have class like this:</p>

<pre><code>public ClassA&lt;T&gt; where T : class{
       ...
}
</code></pre>

<p>Now I need to to create an object of ClassA in the constructor of ClassB:</p>

<pre><code>public ClassB{
   public ClassA&lt;?&gt; objA;
   public ClassB(string TypeInfo){
       objA = new ClassA&lt;?&gt;(); // Suppose TypeInfo = 'ClassC', and the '?'
                               // Should be derived from TypeInfo
   }
   ...
}
</code></pre>

<p>I don't know what to replace '?' for, since the type can only be known at runtime... any ideas?</p>
