Dot Net Core Environment Variable Setup

 Steps for Environment variables 


  1. Add New item type of JSON and give the name - appsettings.Producation.json


  1. Add New item type of JSON and give the name - appsettings.Staging.json

  2. Add New item type of JSON and give the name - appsettings.Development.json


  1. Add appsettins in this appsetting json file.


  1. Find launchSettings.json in the project and Update by Adding Profiles for environments.

    1. "IIS Express (Development)": { 

      "commandName": "IISExpress",

      "launchBrowser": true,

      "launchUrl": "swagger",

      "environmentVariables": {

        "ASPNETCORE_ENVIRONMENT": "Development"

      }


    },

  1.     "IIS Express (Staging)": {

      "commandName": "IISExpress",

      "launchBrowser": true,

      "launchUrl": "swagger",

      "environmentVariables": {

        "ASPNETCORE_ENVIRONMENT": "Staging"

      }


    },

  1.     "IIS Express (Production)": {

      "commandName": "IISExpress",

      "launchBrowser": true,

      "launchUrl": "swagger",

      "environmentVariables": {

        "ASPNETCORE_ENVIRONMENT": "Production"

      }


    }


Comments

Popular posts from this blog

Dot Net Core Middleware (Authorization + Custom Authorize)

GIT Basic Command & Git Command Flow chart