I had the following error in package manager console when Add-Migration
Value cannot be null. Parameter name: connectionString
I had such issue when load tesing the service (I recommend it to all) and had ~3/1000 requests with errors, so I changed
services.AddDbContextPool(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
to
string connectionString = Configuration.GetConnectionString("DefaultConnection");
services.AddDbContextPool(options =>
options.UseSqlServer(connectionString));
So it reads connections string 1 time and doesn't use Configuration on every request. And now 100% requests are successful. But it seems to be a bug in .Net Core