How to use different environment specific appsetting.json for .net core windows application

  .net-core, windows

I have created a .Net core windows application and I have created different appsettings.json for each environment (Say appsettings.qa.json, appsettings.prod.json).

Now I need to run the windows application in the same machine for different environment.

I know in asp.net core web application’s we can set the environment via a web.config so it will be appliation specific.

<aspNetCore>
  <environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="prod" />
  </environmentVariables>
</aspNetCore>

Like the same as in web application I need to set the ASPNETCORE_ENVIRONMENT to the exe application specific.

Source: Windows Questions

LEAVE A COMMENT