Environment settings in Linux

February 18, 2017
.NET Core Ubuntu

Filenames in Linux are case sensitive and the default template for setting up configuration files Startup.cs is unfortunately not taking this in to account. To fix this change

.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)

to

.AddJsonFile($"appsettings.{env.EnvironmentName.ToLower()}.json", optional: true)