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: 
Appsetting.Value = QA

Comments

Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem

JS/JQ simulate Enter event