title: Can not inject IOptions in service
body: <p>I am trying to inject a <code>IOptions</code> inside a service that I created and it is always null:</p>
  
  <pre><code>public class Startup
  {
      private IConfiguration configuration;
      public Startup(IConfiguration config)
      {
          this.configuration = config; //gets injected from Main method , not null !
      }
      public void ConfigureServices(IServiceCollection services)
      {
  
          Config config = configuration.GetSection("Config").Get&lt;Config&gt;();
          services.Configure&lt;Config&gt;(configuration);
          services.AddTransient&lt;StatusService&gt;();
          services.AddCors();
          services.AddOptions();
  
      }
  }
  </code></pre>
  
  <p><strong>Service</strong></p>
  
  <pre><code>internal class StatusService
  {
      private Config config;
      public StatusService(IOptions&lt;Config&gt;_config)
      {
        this.config=_config.Value; // _config has default fields
      }
  }
  </code></pre>
  
  <p><strong>P.S</strong> Config is just a POCO that gets populated in the <code>Program.Main</code> method using <code>UseConfiguration</code> extension.The configuration is parsed OK so no problems there.I get the configuration injected successfully in the <code>Startup</code> constructor.</p>