I'm currently solving the same problem using Web.config:
My Web.config (as default this will be equivalent to Web.Debug.config and Web.Development.config) file contains (using your naming above):
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="mode" value="build"/>
<add key="anotherKey" value="another value"/>
</appSettings>
</configuration>
My Web.Test.config and Web.Release.config files contain:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add key="mode" value="release" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
</appSettings>
</configuration>
Then you can access the 'mode' using:
WebConfigurationManager.AppSettings.Get("mode");
[you don't have to use 'mode' for the key, as long as you are consistent]