Jump to content
  • Advertisement
Sign in to follow this  
Thevenin

Acquring environment permission in C# (Solution provided).

This topic is 4859 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I allow my C# application to access environment variables when its being used as a CGI executable in IIS? I'm using .NET 2.0 btw. Edit For clarity, I'm referring to how to give it the permission to do so. [Edited by - Thevenin on December 1, 2005 2:02:34 PM]

Share this post


Link to post
Share on other sites
Advertisement
I can't figure out how to do this.. >.<

~bump~

Edit: I've also posted this question on the MSDN C# forum and CSharpHome.com.

Share this post


Link to post
Share on other sites
Environment.ExpandEnvironmentVariables(...)

Here are some tips in the right direction:

You might look at demanding security permissions at the assembly level, and maybe even the cas pool.

You might also look at doing something with the machine.config file.

Share this post


Link to post
Share on other sites
Quote:
Original post by BradSnobar
Environment.ExpandEnvironmentVariables(...)


"Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string."

Why would I want todo that? Besides, it still throws EnvironmentPermission error if it doesn't have the permission to access environment variables.

Quote:
Original post by BradSnobar
You might look at demanding security permissions at the assembly level, and maybe even the cas pool.


Tried at the assembly and the code, all it really does is "check" whether you have the permission, if not, it allows you to throw an exception.

Quote:
Original post by BradSnobar
You might also look at doing something with the machine.config file.


I just skimmed through it, I wouldn't even know where to guess at changing things. There are 3 locations where the word "permission" is even used, and in each case, it doesn't say anywhere which permissions it grants.



Share this post


Link to post
Share on other sites
Using "NetworkActiv Software" HTTP/CGI/PHP web hosting server fixed all my problems. NetworkActiv Software allows you to host your web server as root (Which, although not recommended by security experts, is perfectly fine for anyone who knows what they are doing).

Screw IIS! Problem solved. [grin]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!