c# - Entity Framework ConnectionString won't update after changing App.Config in runtime
Entity Framework caches connection string, there isn't a method to force a refresh.
From this article: connection string given in DbContext
constructor isn't cached then you can use this as workaround:
public class MyContext : DbContext {
public MyContext()
: base(ConfigurationManager.ConnectionStrings["MyConnection"].ConnectionString)
{
}
}