Failed to get the API to load the AppSettings section correctly using offers from @dbugger and @competent_tech.
Unable to cast object of type 'System.Configuration.DefaultSection' to type
'System.Configuration.AppSettingsSection'.
In the end, the XML route went through as many lines of code:
XDocument xdoc = XDocument.Load(Path.Combine(Server.MapPath("~"), "web.config")); var query = from e in xdoc.Descendants("appSettings") select e; return query.First().Attribute("configSource").Value;
Thanks to everyone for the pointers.
source share