Dot Net Core Environment Variable Setup
Steps for Environment variables
Add New item type of JSON and give the name - appsettings.Producation.json
Add New item type of JSON and give the name - appsettings.Staging.json
Add New item type of JSON and give the name - appsettings.Development.json
Add appsettins in this appsetting json file.
Find launchSettings.json in the project and Update by Adding Profiles for environments.
"IIS Express (Development)": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express (Staging)": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Staging"
}
},
"IIS Express (Production)": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
}
Comments
Post a Comment