Tuesday, 22 March 2022

Accessing Configuration Information

 # Accessing configuration information

1. To access configuration information in the Startup class, inject the IConfiguration service provided by the Framework.
2. IConfiguration service is setup to read configuration information from all the various configuration sources in asp.net core
3. If you have a configuration setting with the same key in multiple configuration sources, the later configuration sources override the earlier configuration sources
4. CreateDefaultBuilder() method of the WebHost class which is automatically invoked when the application starts, reads the configuration sources in a specific order.
5. Following is the default order in which the various configuration sources are read
    - appsettings.json,
    - appsettings.{Environment}.json
    - User secrets
    - Environment variables
    - Command-line arguments



No comments:

Post a Comment

Search This Blog

Creating your first "Alexa" Skill

Index What is Alexa What is Alexa Skill? Why is it required when Alexa already equipped with voice assistant? Dev...