ProcessStartInfo.EnvironmentVariables:
A string dictionary that provides environment variables that apply to this process and child processes.
ProcessStartInfo.Environment:
A generic dictionary containing the environment variables that apply to this process and its child processes.
On .NET Framework applications, using the Environment property is the same as using the EnvironmentVariables property.
And on not .NET Framework applications, what is the difference between ProcessStartInfo.EnvironmentVariables and ProcessStartInfo.Environment?
They have different return types, but otherwise there is no functional difference.
According to this github issue, the .NET Core language designers wanted to use a standard IDictionary<> rather than the somewhat archaic StringDictionary used by the original EnvironmentVariables property. They couldn't change the return type of the existing property without breaking compatibility with .NET framework, so they added a new, mostly redundant, property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With