My appsettings files does work I see them being used according to which launching profile I use however my localhost profile doesn't work because it doesn't seems to exist in the actual Framework I use. Is there anyway to add a custom one such as "localhost"?


Edit :

Thanks!
In your Program.cs, add a call to config.AddJsonFile():
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostingContext, config) =>
{
config.AddJsonFile("appsettings.Localhost.json", optional: true);
})
.UseStartup<Startup>();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With