There are questions pertaining to reading settings from a separate config file and others similar to it, but my question is specific to application property settings (i.e. <
The solution suggested by Pat:
// Get the whole XML inside the settings node
var settings = import.XPathSelectElements("//" + appSettingsXmlName);
returns null
. I changed it to
var settings = import.Element("configuration").Element("userSettings").Element(appSettingsXmlName);
config.GetSectionGroup("userSettings")
.Sections[appSettingsXmlName]
.SectionInformation
.SetRawXml(settings.ToString());
And it works perfectly.