Can't read customized Configuration file

  • Thread starter Thread starter Jeff0803
  • Start date Start date
J

Jeff0803

Guest
I generated a customized configuration file and try to read it like following.

ConfigurationManager.OpenExeConfiguration(@"c:\App1.Config");
var customSections = ConfigurationManager.GetSection(SectionName) as NameValueCollection;
if (customSections != null)
{
foreach (var key in customSections.AllKeys)
{
string value = customSections.GetValues(key).FirstOrDefault();
}
}

However customSections is not of App1.Config but of Application's configuration file(App.Config).

How to read custom sections from customized configuration file?

Continue reading...
 
Back
Top