Configuration Execution Order in ASP.NET Core App
The default orders in which the various configuration sources are read for the same key are as follows:
1. appsettings.json
2. appsettings.{Environment}.json here we use appsettings.Development.json
3. User secrets
4. Environment Variables
Add a Key in appsettings.Development.json file
Register in Program.cs file to show value of this custom key
Run your application
Now add the same key as “MyCustomKey”: “MyCustomKey Value coming from Environment Variable of launchsSettings.json” in the IIS Express Profile Section of the launchSettings.json file
Run your application