1

Some background: I have an application that I've recently migrated from .NET Framework to .NET Core. There's a live and a test environment, both published to the same server (and I can't change this). There are certain settings that change between these versions which now live in appsettings.json and appsettings.Development.json where previously it had a Web.config that would be combined from a Release and Development Web.config. Publishing is done through Visual Studio and uploaded via FTP.

Now, I have before been able to rely on the Configuration flag when publishing (Also needed for various #IF DEBUGs). However setting it to debug doesn't make appsettings.Development override appsettings where I would kind of expect it.

I know I should be able to set ASPNETCORE_ENVIRONMENT or DOTNET_ENVIRONMENT however I'm not sure where I should set those. I can't set them globally because both live and test live on the same server. So I guess they should be set locally, but where?

Ja Da
  • 230
  • 2
  • 12

0 Answers0