Had the same problem, but solved it in a different way. It might not be the best solution, but its a solution.
in app.config:
<add key="errorMailFirst" value="[email protected]"/>
<add key="errorMailSeond" value="[email protected]"/>
Then in my configuration wrapper class, I add a method to search keys.
public List<string> SearchKeys(string searchTerm)
{
var keys = ConfigurationManager.AppSettings.Keys;
return keys.Cast<object>()
.Where(key => key.ToString().ToLower()
.Contains(searchTerm.ToLower()))
.Select(key => ConfigurationManager.AppSettings.Get(key.ToString())).ToList();
}
For anyone reading this, i agree that creating your own custom configuration section is cleaner, and more secure, but for small projects, where you need something quick, this might solve it.