The EnvironmentVariables in ProcessStartInfo.EnvironmentVariables (type StringDictionary) are always set to lower-case when I insert something into it. For example:
proc.StartInfo.EnvironmentVariables.Clear();
proc.StartInfo.EnvironmentVariables.Add("REDIRECT_STATUS", "");
// [snipped more variables being added here]
proc.Start();
In the process there now is a redirect_status, and not a REDIRECT_STATUS as I wanted. This causes problems.
I already read somewhere else that you could get around this issue by making a batch file, however this is not applicable in my case, as this is meant to be used as CGI (this code could potentially be called 10 times a second.)
Is there a way to get the EnvironmentVariables to not be case insensitive, and just allow me to go all-caps?
Hmm, note to everybody out there who’s also having this problem: Apparantly, this is a bug in .Net 3.5 and is fixed in 4.0.
I had to switch to .Net 4.0 to resolve this issue.