I have a web application with over 200 configuration settings. These control everything from UI to Business logic.
Should these be retrieved on application startup o
I agree with Kelsey, don't overcomplicate things and just use the .NET framework classes for retrieving the values. Web.config is usually where you'd keep them.
I would however recommend creating a simple static class for access:
using System.Configuration // Add a reference for this... ;
public static class Config
{
public static string DbConnection
{
get
{
return ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
}
}
public static string SomeValue
{
get
{
return ConfigurationManager.AppSettings["SomeValue"].ToString();
}
}
}
It'll give you strongly typed values and easy access. You can also perform some kind of validation with a class like this. Very handy. And if you later decide not to use web.config, this class is easily changed to retrieve the values elsewhere.