title: Cannot read connectionString from appsettings.json
body: <p>I am creating a class library that needs to communicate with a Sqlite Database, using .NET Core and EF Core. </p>
  
  <p>I'm executing my code from a Test Project in the same solution</p>
  
  <p>The issue is <code>GetConnectionString()</code> always returns null. </p>
  
  <p>My appsettings.json is</p>
  
  <pre><code>{
    "Logging": {
      "LogLevel": {
        "Default": "Debug",
        "System": "Information",
        "Microsoft": "Information"
      }
    },
      "ConnectionStrings": {
        "TestingDatabase": "Server=c:\\myDb.db;Version=3;"
      }
    }
  </code></pre>
  
  <p>And my Entities file is</p>
  
  <pre><code>  public Entities()
    {
        _configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json", true,true)
              .Build();
    }
  
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        var connectionString = _configuration.GetConnectionString("TestingDatabase"); // always returns null
        optionsBuilder.UseSqlite(connectionString);
    }
  </code></pre>
  
  <p>I don't understand why. </p>