I have two web services deployed in the same directory. I am trying to read a value from Web.config
file of one of the web services from the other. Is this possible?
i tried this but its not working:
protected static string GetApplicationSettings(string sKey)
{
string sValue = null;
System.Configuration.Configuration rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/WebServiceTest/WebServiceTest/web.config");
//check if the AppSettings section has items
if (rootWebConfig.AppSettings.Settings.Count > 0)
{
sValue = rootWebConfig.AppSettings.Settings[sKey].Value;
}
return sValue;
}