Skip to content

Instantly share code, notes, and snippets.

@codearoo
codearoo / App.config
Created June 13, 2012 14:49
Cleaner way to define and use App.config or Web.config settings in .Net. Setting names correspond to the namespace and class name of where they are defined in the code. Makes it easy to know exactly where the setting is defined.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<!--This is how your config file would look.-->
<add key="SomeNameSpace.Class1.STATIC" value="This is my static setting"/>
<add key="SomeNameSpace.Class1.STATIC_VERIFIED" value="This is my static setting that is verified to exist"/>
<add key="SomeNameSpace.Class1.NONSTATIC" value="This is my non-static setting"/>
<add key="SomeNameSpace.Class1.TESTMETHOD.SOMETHING.SPECIFIC" value="Some specific setting"/>