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

OverTheWire[.com] Natas Walkthrough - JUST HINT, NO SPOILERS

Asp.Net Ending Response options, Response.End() vs CompleteRequest()

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