0
kicks
Using T4 to generate a class wrapper for <appSettings />
Last week I wanted to generate a object wrapper around the <appSettings> section in my web.config/app.config file and after doing the same thing over and over again by generating a public read-only property for each setting, I decided to use T4 to read the <appSettings> section and generate a class all the properties that would become the wrapper around the ConfigurationManager.AppSettings[“…”] calls to retrieve the settings. To my surprise, this was pretty easy to do.