internal void DeserializeConfigSource(string basePath)
{
var configSource = SectionInformation.ConfigSource;
if (string.IsNullOrEmpty(configSource))
{
return;
}
if (Path.IsPathRooted(configSource))
{
throw new ConfigurationErrorsException("The configSource attribute must be a relative physical path.");
}
if (HasLocalModifications())
{
throw new ConfigurationErrorsException(
"A section using 'configSource' may contain no other attributes or elements.");
}
string path = Path.Combine(basePath, configSource);
if (!File.Exists(path))
{
RawXml = null;
SectionInformation.SetRawXml(null);
throw new ConfigurationErrorsException(string.Format("Unable to open configSource file '{0}'.", path));
}
RawXml = File.ReadAllText(path);
SectionInformation.SetRawXml(RawXml);
DeserializeElement(XmlReader.Create(new StringReader(RawXml)), false);
}