Using the Microsoft.Extensions.Configuration package, I have the following line in my Program.cs file:
config.AddUserSecrets(optional: false);