It is possible to use an encapsulating class that performs this null check for you, but that breaks the relationship of the configuration model almost making it pointless. Unless you define a standard within your own architecture to use that scheme always that is. You could easily define your own configuration manager class that receives the key, checks the regular configuration manager for null and then returns the result.
public class myConfig
{
public string AppSettings(string key)
{
get
{
//if(System.Configuration.ConfigurationManager.AppSettings(key) != null)
// return System.Configuration.ConfigurationManager.AppSettings(key);
//else
// return String.Empty;
// Null coalescing for @Paul :)
return System.Configuration.ConfigurationManager.AppSettings(key) ?? String.Empty;
}
}
}
Or something similar.