From the course: ASP.NET: Security

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Externalizing Web.config settings

Externalizing Web.config settings

From the course: ASP.NET: Security

Start my 1-month free trial

Externalizing Web.config settings

- [Instructor] One approach to put sensitive information that usually resides in web.config, to another place, so that maybe it can be excluded from a repository check in, is to externalize certain configuration settings. Truth be told, that's not my favorite approach, but I still would like to cover it, and show you which options you have, and especially what differences there are, because that's pretty important when you use that yourself, in your applications. What you can do with "appSettings", is that you provide a file name with additional "appSettings". You use the "file" attribute of the "appSettings" node, and then reference a different config file. Note that I also use the ".config" file extension here, thanks to the .NET Framework preventing this from being downloaded via HTTP. And the idea is now that web.config will be checked into the repository, because there might be important settings for the application to actually run, however, all the secrets are in another file…

Contents