In a console application, I'm using the following setup:
IHost host = Host.CreateDefaultBuilder()
.ConfigureServices((context, services) =>
{
services.AddSingleton<Program>();
string someConfigItem = context.Configuration["SomeConfigItem"];
})
.Build();
host.Services.GetRequiredService<Program>().Go();
This automatically reads from appsettings.json without having to explicitly use a configuration builder or anything like that.
What if I want to add an additional JSON file? With the configuration builder, you can just add multiple files by just calling .AddJsonFile() multiple times, but I can't seem to find a place to do add more files here.