Error!
Success!

Using T4 to generate a class wrapper for <appSettings />

0
kicks

Using T4 to generate a class wrapper for &lt;appSettings /&gt;  (Unpublished)

Last week I wanted to generate a object wrapper around the &lt;appSettings&gt; 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 &lt;appSettings&gt; 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.


Kicked By:
Drop Kicked By: