title: ef core migration can't use secret manager
body: <p>When I create .net core web applications, I use the secret manager during testing. I am generally able to create a new web project (mvc and web api), right click on the project and select "manage user secrets". This opens a json file where I add the secrets. I then use this in my startup.cs something like this: </p>
  
  <pre><code>services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
      options.UseMySql(Configuration["connectionString"]));
  </code></pre>
  
  <p>The website works fine with this and connects well to the database. However when I try using ef core migration commands such as <code>add-migration</code>, they don't seem to be able to access the connection string from the secret manager. I get the error saying "connection string can't be null". The error is gone when I hard code <code>Configuration["connectionString"]</code> with the actual string. I have checked online and checked the .csproj file, they already contain the following lines: </p>
  
  <pre><code>&lt;UserSecretsId&gt;My app name&lt;/UserSecretsId&gt;
  </code></pre>
  
  <p>And later:</p>
  
  <pre><code>&lt;ItemGroup&gt;
  &lt;DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.1" /&gt;
  &lt;DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" /&gt;
  </code></pre>
  
  <p>Is there anything I need to add so the migrations can access the connection string? </p>
  
  <p><strong>Update</strong></p>
  
  <p>I only have one constructor in the context class:</p>
  
  <pre><code>public ApplicationDBContext(DbContextOptions&lt;ApplicationDBContext&gt; options) : base(options)
  {
  }
  </code></pre>