I'm trying to change assembly binding (from one version to another) dynamically.
I've tried this code but it doesn't work:
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConfigurationSection assemblyBindingSection = config.Sections["assemblyBinding"];
assemblyBindingSection.SectionInformation.ConfigSource = "bindingConf.xml";
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("assemblyBinding");
with bindingConf.xml
containing the assemblyBinding section configuration.
So can a change this section at runtime? how to do it? What alternatives do I have?
See Question&Answers more detail:os