I had the following error in package manager console when Add-Migration
Value cannot be null. Parameter name: connectionString
This worked flawlessly for me:
public IConfiguration Configuration;
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext(options =>
//options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
options.UseSqlServer("Server=serverAddress; Database=dbName; user=username; password=pswd"));
}
The commented part is just as reference where to replace.