[Mono-list] Compiling C# program with Request object

Damien DALY maitredede at gmail.com
Fri Jul 11 10:39:38 EDT 2008

> I had been trying to use: System.Environment.GetEnvironmentVariable, which
> works perfectly on the CLI, but when I run it in the IIS CGI environment I
> get:
> Unhandled Exception: System.Security.SecurityException: Request for the
> permission of type 'System.Security.Permissions.EnvironmentPermission,
> mscorlib, Version=, Culture=neutral,
> PublicKeyToken=b77a5c561934e089'
> failed
> So I guess I need to grant it permissions to get the environment variable,
> but I don't have a clue how to do this.


This is about the user the CGI runs...
In most cases, IIS user is IUSR_machine, a kind of equivalent to unix user

Due to security restrictions of the IUSR_machine user, it can't acces to its
environement variables. So you have to search in IIS how you can change the
user it uses for CGI access...

Good luck

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20080711/e86cb4b1/attachment.html 

More information about the Mono-list mailing list