title: Register Open Generic with dotnet core 3
body: <p>I'm trying to register an Open Generic type in my application but I'm having a strange behavior.</p>
  
  <p>The following is working correctly:</p>
  
  <pre><code>services.AddTransient(typeof(IA&lt;&gt;), typeof(A&lt;&gt;));
  </code></pre>
  
  <p>Now, I would like to pass parameters to my <code>A</code> class, because my constructor has some arguments:</p>
  
  <pre><code>services.AddTransient(typeof(IA&lt;&gt;), provider =&gt;
  {
      return ActivatorUtilities.CreateInstance(provider, typeof(A&lt;&gt;), "1", "2");
  });
  </code></pre>
  
  <p>This generates an exception</p>
  
  <blockquote>
    <p>'Open generic service type 'IA`1[T]'
    requires registering an open generic implementation type. (Parameter
    'descriptors')'</p>
  </blockquote>
  
  <p>Ok so I simplified my factory, and just did something like this:</p>
  
  <pre><code>services.AddTransient(typeof(IA&lt;&gt;), provider =&gt; typeof(A&lt;&gt;));
  </code></pre>
  
  <p>But this generates exactly the same exception.</p>
  
  <p>Question is simple: How to register an Open Generic with parameters with the default .net core DI ? (I don't want to use a third party library like Castle Windsor)</p>
  
  <p>Note that the constructor of <code>A&lt;&gt;</code> has optional parameter, this is why <code>services.AddTransient(typeof(IA&lt;&gt;), typeof(A&lt;&gt;));</code> is working</p>