PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, August 22, 2022

[FIXED] What is the difference between ProcessStartInfo.EnvironmentVariables and ProcessStartInfo.Environment

 August 22, 2022     .net-core, c#, environment-variables, process     No comments   

Issue

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?


Solution

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.



Answered By - Darryl
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing