In the appSettingsweb.config file, I use this key:
<add key="CurrentEnvironment" value="0"/>
And as you can see in my comments, this corresponds to Enum in my Helpers.vb class, which is used like this:
Public Shared CurrentEnvironment As Environments = DirectCast(WebConfigurationManager.AppSettings("CurrentEnvironment"), Environments)
This allows you to write environment-specific code such as URLs, database connections, etc.
I found it very useful.
- sorry for the VB.NET code, but I'm sure you can easily hide -
EDIT based on OP editing:
Why don't you create a Unit Test project ?
source
share