I look at several topics e.g. Automatically set appsettings.json for dev and release environments in asp.net core? and see that I can create appsettings.{Environment}.json in .NET Core apps and set the environment in launchSettings.json
.
However, I am wondering what should I do to set this environment properly while publishing my app to IIS or Docker container. Before each publishing, should I change the environmentVariables
parameter to Prod and then update it to Development after publish? I do not think so, but I could not find a suitable page explaining this. Could you please clarify me about this issue?