I'm creating a .NET Standard 2.0 library to be consumed from a .NET Framework 4.6.1 application.
This library needs EF Core, but I can't figure out how to read the app.config.
In a .NET Framework library I would initialize my DBContext like this:
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseSqlServer(ConfigurationManager.ConnectionStrings["MyDatabase"].ConnectionString);
}
But I can't do it since ConfigurationManager is nowhere to be found in .NET Standard 2.0.
How can I read the configuration file from a .NET Standard 2.0 library?