Include Microsoft.Net.Sdk in CLI layout (#4895)
* WiP * Update test * Working version of Net SDK * Latest SDK doesn't work as packageref * DCR + PR * Harden CLI tests against #4884
This commit is contained in:
parent
4311926366
commit
d2d0353e60
9 changed files with 114 additions and 20 deletions
|
@ -25,6 +25,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
|
||||
private List<Action<string>> _writeLines = new List<Action<string>>();
|
||||
|
||||
private List<string> _cliGeneratedEnvironmentVariables = new List<string> { "MSBuildSDKsPath" };
|
||||
|
||||
public TestCommand(string command)
|
||||
{
|
||||
_command = command;
|
||||
|
@ -178,6 +180,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
UseShellExecute = false
|
||||
};
|
||||
|
||||
RemoveCliGeneratedEnvironmentVariables(psi);
|
||||
|
||||
foreach (var item in Environment)
|
||||
{
|
||||
#if NET451
|
||||
|
@ -219,5 +223,17 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
|
||||
return $" in pwd {WorkingDirectory}";
|
||||
}
|
||||
|
||||
private void RemoveCliGeneratedEnvironmentVariables(ProcessStartInfo psi)
|
||||
{
|
||||
foreach (var name in _cliGeneratedEnvironmentVariables)
|
||||
{
|
||||
#if NET451
|
||||
psi.EnvironmentVariables.Remove(name);
|
||||
#else
|
||||
psi.Environment.Remove(name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue