From the course: Learning ASP.NET Core MVC
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Populate configuration settings
From the course: Learning ASP.NET Core MVC
Populate configuration settings
- [Instructor] Now that I've shown you the basics of the configuration API using environment variables, I'll show you how to configure your application using a configuration file, you might have noticed that one of the very few files that Visual Studio created for me when I created the project, was this file, named appsettings.JSON. As the file extension indicates, the contents of this file are just one big JSON object. Which I can use to set whatever configuration values I like, that means if I wanted to set that configuration setting, enable developer exceptions from a configuration file instead of from an environment variable, I can simply define it as a property like this. With this in place I can now run the site, and then step through my breakpoint to see that the value of enable developer exceptions, is true. Now if you think that's as cool as I do, you'll love this part. The configuration API also allows you to read complex JSON objects, in other words I can update the JSON…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Building blocks of ASP.NET Core applications5m 54s
-
Create a new project4m 44s
-
(Locked)
Respond to HTTP requests5m 32s
-
Serving static files2m 18s
-
(Locked)
Error handling and diagnostics4m 55s
-
(Locked)
Use custom configuration4m 21s
-
(Locked)
Populate configuration settings3m 9s
-
(Locked)
Increase maintainablility with dependency injection5m 53s
-
-
-
-
-
-
-