Quantcast
Viewing latest article 2
Browse Latest Browse All 2

Merge appsettings.{env}.json into appsettings.json in .NET Core 3.1

I understand the default behavior in .NET Core 3.1 is that when you publish your solution, it copies over all your appsettings.{env}.json files into the final package, and it is up to your environment variable to determine which one will be taken into account at run time.

However, due to a situation regarding some badly setup legacy systems, I need to find a way to make the publishing behave similar to that of the old .NET Framework, where you could have multiple Web.{env}.Config files and when you published, depending on the config parameter you passed, one final web.config was generated which was the result of merging the web.env.config and the general web.config.

I need to implement the exact same behavior with appsettings.json when publishing a .NET Core 3.1 project.

Is that possible? And how?


Viewing latest article 2
Browse Latest Browse All 2

Trending Articles