title: How to instantiate an interface, with a generic parameter
body: <p>I have some classes that implement the interface below:</p>
  
  <pre><code>ISearchBase&lt;T&gt;
  </code></pre>
  
  <p>But I don't know which class will be instantiated, so I let "the user decide", like the example below:</p>
  
  <pre><code>var objectResponse = Activator.CreateInstance(Type.GetType(ResponseNamespace));
  </code></pre>
  
  <p>The problem is:
  Each those classes has a return and I'm trying to use like this:</p>
  
  <pre><code>var object = (ISearchBase&lt;objectResponse &gt;)
            Activator.CreateInstance(Type.GetType(Namespace));
  </code></pre>
  
  <p>But the compiler won't let me do this... What can I do?</p>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>The type or namespace name 'objectResponse' could not be found.</p>
  </blockquote>