Why won't Environment.GetEnvironmentVariable ("variableName") get the value of the variable if the call is made from webMethod hosted in iis and will work if I call it from the console application on the same computer?
Where can I configure these variables for visibility for IIS web services? Should I use the second parameter from Environment.GetEnvironmentVariable (name, purpose) to get it?
This is actually really simple:
<code> [WebMethod(Description = "Gets the environment variable value.")] public string GetEnvironmentVariable() { return Environment.GetEnvironmentVariable("VARIABLE_NAME_HERE"); } </code>
And by the way, VARIABLE_NAME_HERE is installed at the system and user level.
Thanks in advance
Lemmerich
source share