title: System.ArgumentNullException: 'Value cannot be null. Parameter name: provider'
body: <p>I'm trying to consume a web api that adds a user in a database, so I created this startup class:</p>
  <pre class="lang-cs prettyprint-override"><code>    public static class Startup
      {
          private static IServiceProvider serviceProvider;
          public static void ConfigureServices()
          {
              var services = new ServiceCollection();
              //add services
              services.AddHttpClient&lt;IUserServices, ApiUserServices&gt;(c =&gt; 
              {
                  c.BaseAddress = new Uri(&quot;http://10.0.2.2:9129/api/&quot;);
                  c.DefaultRequestHeaders.Add(&quot;Accept&quot;, &quot;application/json&quot;);
              });
  
              //add viewmodels
              services.AddTransient&lt;SignUpPageViewModel&gt;();
  
              serviceProvider = services.BuildServiceProvider();
          }
    
  
          public static T Resolve&lt;T&gt;() =&gt; serviceProvider.GetService&lt;T&gt;();
  
      }
  </code></pre>
  <p>But I got this exception:
  System.ArgumentNullException: 'Value cannot be null. Parameter name: provider'</p>