title: Why am i getting argumentNullException when adding migration
body: <p>I'm trying to create a migration in my web api for one-to-many db. Services are configured this way and the connection string is successfully received from launchsettings.json</p>
  <pre><code>var connectionStr = Environment.GetEnvironmentVariable(&quot;ApplicationDbContext&quot;);
  
  services.AddDbContext&lt;InsolationResultContext&gt;(options =&gt;
  {
  options.UseNpgsql(connectionStr, builder =&gt;
  {
          builder.CommandTimeout(300);
          builder.EnableRetryOnFailure(5, TimeSpan.FromSeconds(10), null);
        });
  });
  </code></pre>
  <p>This are models</p>
  <pre><code>public class DocumentInsolationResult
      {
          public string Id { get; set; }
  
          public string UserId { get; set; }
  
          public IEnumerable&lt;InsolationResult&gt; Elements { get; set; }
      }
  public class InsolationResult
      {
          public string UniqueId { get; set; }
  
          public string Insolation { get; set; }
      }
  </code></pre>
  <p>And DbContext</p>
  <pre><code>public class InsolationResultContext : DbContext
      {
          public DbSet&lt;DocumentInsolationResult&gt; DocumentInsolationResults { get; set; }
          public DbSet&lt;InsolationResult&gt; InsolationResults { get; set; }
  
          public InsolationResultContext(DbContextOptions&lt;InsolationResultContext&gt; options)
              : base(options)
          {
  
          }
  
  
          protected override void OnModelCreating(ModelBuilder modelBuilder)
          {
              modelBuilder.Entity&lt;DocumentInsolationResult&gt;()
                  .HasMany(p =&gt; p.Elements)
                  .WithOne();
          }
      }
  </code></pre>
  <p>the connection string looks like this:</p>
  <pre><code>&quot;environmentVariables&quot;: {
          &quot;ApplicationDbContext&quot;: &quot;Host=192.168.1.***;Port=****;Database=***.******;Username=*****;Password=****&quot;,
          &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
        },
  </code></pre>
  <p>When trying to &quot;Add-Migartion Init i always get &quot;Value cannot be null. (Paramtere 'connectionString'). What am i doing wrong? Coulnd't actually find the answer on the internet</p>
  <p>upd: i'me receiving the connection string from launchsetting, it's ok as i'm using the same way of getting connectionString on some other projects</p>
  <p>upd2 hardcoding the connection string worked for me</p>