title: The non-generic method 'IServiceProvider.GetService(Type)' cannot be used with type arguments
body: <p>I am using .NET Core dependency injection, but when I am trying to get the service in another class, I am getting the 'IServiceProvider.GetService(Type)' cannot be used with type arguments' error. </p>
  
  <p>What does this error means? 
  I understand that a generic type argument is something like this: GenericInterface&lt;>, and the GetService method does not take the GenericInterface&lt;> as an argument. </p>
  
  <p>Why am I getting this error and how do I solve it?</p>
  
  <p>The interface</p>
  
  <pre><code>public interface IService
  {
     void Process();
  }
  </code></pre>
  
  <p>The class implementing the interface</p>
  
  <pre><code>public class Service : BaseService&lt;IConfig, SomType&gt;
  {
      public Service(
          ILogger logger : base(logger)
      {
      }
  
      ...
  }
  </code></pre>
  
  <p>The BaseService class is an abstract class and it implements the IService interface. </p>
  
  <pre><code>public abstract class BaseService&lt;TConfig, TE&gt; : AnotherBaseService, IService where TConfig : IConfig where TE : struct, IConvertible
  {
        protected BaseService(ILogger logger): base(logger)
        {
        } 
  
        ...
  }
  </code></pre>
  
  <p>The AnotherBaseService</p>
  
  <pre><code>public abstract class BaseService
  {
     protected readonly ILogger Logger;
  
     protected BaseService(ILogger logger)
     {
        Logger = logger;
     }
  
     ...
  }
  </code></pre>
  
  <p>How I registered them.</p>
  
  <pre><code>serviceCollection.AddScoped&lt;IService, Service&gt;();
  </code></pre>
  
  <p>How I am getting the service I need. </p>
  
  <pre><code>var incoming = serviceProvider.GetService&lt;IService&gt;();
  </code></pre>
  
  <p>NB: I am just getting started with dependency injection, .NET Core and do not know everything about DI just yet. Your answers would be of great help. </p>