I have a winforms application in which some of the data is stored in XML files. The location where these XML files should be stored can be configured by the user, and is stored in the AppSettings. All my layers are separate assemblies. Can I access my settings from my DAL assembly, or should I pass this as an argument through all my layers?
When I try to read the settings from my DAL layer, I encounter another problem
Configuration config = ConfigurationManager.OpenExeConfiguration(
System.Reflection.Assembly.GetEntryAssembly().Location);
string dataStorageLocation = config.AppSettings["DataStorageLocation"];
config.AppSettings["DataStorageLocation"] gives a compilation error: System.Configuration.ConfigurationElement.this[System.Configuration.ConfigurationProperty] is inaccessible due to its protection level. Why is that?
Can someone put me on the right track? Thanks.