pass Info from web.app to Dll
in the web.app:
Configuration config = WebConfigurationManager.OpenWebConfiguration("~/");
#if QA
config.AppSettings.Settings.Add("EnviormentVar", "QA");
#endif
config.Save();
in the dll:
System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration("~/");
KeyValueConfigurationElement Appsetting = config.AppSettings.Settings["EnviormentVar"];
return (Appsetting.Key + " <br/>" + "Value:" + Appsetting.Value);
u'll get:
Configuration config = WebConfigurationManager.OpenWebConfiguration("~/");
#if QA
#endif
config.Save();
in the dll:
System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration("~/");
KeyValueConfigurationElement Appsetting = config.AppSettings.Settings["EnviormentVar"];
return (Appsetting.Key + " <br/>" + "Value:" + Appsetting.Value);
u'll get:
Appsetting.Value = QA
Comments
Post a Comment