[Mono-dev] Environment.GetEnvironmentVariable() not working in Linux ASP.NET app

Bojan Rajkovic brajkovic at coderinserepeat.com
Thu Nov 3 09:14:18 EDT 2011

On Nov 3, 2011, at 9:12 AM, H . wrote:

> Hi Robert,
> thanks for your hints.
> The link sent describes how environment variables can be set up in Ubuntu. Of course, nobody would try to manually set up environment variables when trying to configure proxies. This is done by using System>Settings>Network Proxy. After that, Ubuntu sets up the necessary environment variables. In case of the no_proxy environment variable this can be tested by issuing "echo $no_proxy" on the command line.
> My question is not about setting up environment variables. I need to retrieve the content of $no_proxy via C# in an ASP.NET app.

In all likelihood, the ASP.NET user (probably www-data, the Apache/Nginx/Lighttpd user) doesn't even have NO_PROXY set in its environment, since it doesn't make sense to set it. If you want NO_PROXY to propagate to the web server's environment, you'll have to edit its startup scripts to do so.

Hope that helps.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20111103/92ec8d77/attachment-0001.html 

More information about the Mono-devel-list mailing list