I would like to share my AppSettings from Application.exe.config to be shared/used by the newly created AppDomains . I am creating AppDomains as shown below
public static AppDomain Create(Guid sessionId)
{
AppDomain currentDomain = AppDomain.CurrentDomain;
AppDomainSetup setup = new AppDomainSetup();
// use the ID as part of the unique name for the process
string name = "Session_" + sessionId;
setup.ApplicationName = name;
setup.ApplicationBase = currentDomain.SetupInformation.ApplicationBase;
setup.PrivateBinPath = currentDomain.SetupInformation.PrivateBinPath;
setup.ConfigurationFile = currentDomain.SetupInformation.ConfigurationFile;
Evidence baseEvidence = currentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
return AppDomain.CreateDomain(name, evidence, setup);
}
Do I need to have any additional steps to have ConfigurationManager.AppSettings[key] return the same values as the original AppDomain ?