public void EnvironmentVariable(string name, string value) { if (_forwardingApp != null) { _forwardingApp.WithEnvironmentVariable(name, value); } else { _msbuildRequiredEnvironmentVariables.Add(name, value); } if (value == string.Empty || value == "\0") { // Unlike ProcessStartInfo.EnvironmentVariables, Environment.SetEnvironmentVariable can't set a variable // to an empty value, so we just fall back to calling MSBuild out-of-proc if we encounter this case. // https://github.com/dotnet/runtime/issues/50554 InitializeForOutOfProcForwarding(); } }
public void EnvironmentVariable(string name, string value) { if (_forwardingApp != null) { _forwardingApp.WithEnvironmentVariable(name, value); } else { _msbuildRequiredEnvironmentVariables.Add(name, value); } if (value == string.Empty || value == "\0") { // Do not allow MSBuild NOIPROCNODE as null env vars are not properly transferred to build nodes _msbuildRequiredEnvironmentVariables["MSBUILDNOINPROCNODE"] = "0"; // Unlike ProcessStartInfo.EnvironmentVariables, Environment.SetEnvironmentVariable can't set a variable // to an empty value, so we just fall back to calling MSBuild out-of-proc if we encounter this case. // https://github.com/dotnet/runtime/issues/50554 InitializeForOutOfProcForwarding(); } }
public void EnvironmentVariable(string name, string value) { _forwardingApp.WithEnvironmentVariable(name, value); }