Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tridion.Configuration.ConfigurationSections tcmConfigSections = (Tridion.Configuration.ConfigurationSections)ConfigurationManager.GetSection(Tridion.Configuration.ConfigurationSections.SectionName);
var tcmSectionElem = tcmConfigSections.Sections.Cast<Tridion.Configuration.SectionElement>().FirstOrDefault(s => !string.IsNullOrEmpty(s.FilePath) && s.FilePath.EndsWith("tridion.contentmanager.config", StringComparison.InvariantCultureIgnoreCase));
if(tcmSectionElem != null)
{
var tcmConfigFilePath = tcmSectionElem.FilePath;
//load Tridion.ContentManager.config
ExeConfigurationFileMap map = new ExeConfigurationFileMap { ExeConfigFilename = tcmConfigFilePath };
var config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
var myCustomResolverSettings = ((AppSettingsSection)config.GetSection("My.Tridion.CustomResolving")).Settings;
var schemaTitles = myCustomResolverSettings["schemaTitles"].Value.ToString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.