title: Dependency Injection in CLI Main, object is null
body: <p>In my CLI Main I need a object of my MonDbBusinessComponent class.
  I wrote the code below, but my object is still null.
  What's wrong? How to do it right?</p>
  
  <pre><code>public static IMonDbBusinessComponent monDbBusinessComponent { get; set; }
  static void Main(string[] args)
  {
      var collection = new ServiceCollection();
      collection.AddScoped&lt;IMonDbRepository, MonDbRepository&gt;();
      ServiceProvider appServiceProvider = GetServiceProvider();
      monDbBusinessComponent = appServiceProvider.GetService&lt;IMonDbBusinessComponent&gt;();
  </code></pre>