From the course: Blazor WebAssembly: Foundational Skills
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Appsettings.json - Blazor Tutorial
From the course: Blazor WebAssembly: Foundational Skills
Appsettings.json
- [Instructor] Appsettings.json is the configuration file used for Blazor applications and it's found in the wwwroot folder of the application. Since it's JSON file, it follows the JSON format. With the settings it uses the key-value pair. Settings can also be nested as well and can be used by injecting the IConfiguration instance into a Razor component. The appsettings.json file is located in the wwwroot folder of the application. If the file doesn't exist, it can be created by right clicking on the wwwroot folder, going to Add and go into New Item. Find App Settings File and give it a name. Inside the file there are some settings related to the hero banner that appears on the product listing page. This can be seen when viewing the product listing page. However, the settings are hard coded to the hero component. To pull the settings from the appsettings.json inject the IConfiguration instance. To do that, use the app…