Skip to content

Commit

Permalink
set DOTNET_MULTILEVEL_LOOKUP=0 to get customDotNetCli path working, f…
Browse files Browse the repository at this point in the history
…ixes #820
  • Loading branch information
adamsitnik committed Jul 4, 2018
1 parent 33e5686 commit 844e959
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ internal static string GetDotNetSdkVersion()
internal static ProcessStartInfo BuildStartInfo(string customDotNetCliPath, string workingDirectory, string arguments,
IReadOnlyList<EnvironmentVariable> environmentVariables = null, bool redirectStandardInput = false)
{
const string dotnetMultiLevelLookupEnvVarName = "DOTNET_MULTILEVEL_LOOKUP";

var startInfo = new ProcessStartInfo
{
FileName = customDotNetCliPath ?? "dotnet",
Expand All @@ -112,6 +114,9 @@ internal static ProcessStartInfo BuildStartInfo(string customDotNetCliPath, stri
foreach (var environmentVariable in environmentVariables)
startInfo.EnvironmentVariables[environmentVariable.Key] = environmentVariable.Value;

if (!string.IsNullOrEmpty(customDotNetCliPath) && (environmentVariables == null || !environmentVariables.Any(envVar => envVar.Key == dotnetMultiLevelLookupEnvVarName)))
startInfo.EnvironmentVariables[dotnetMultiLevelLookupEnvVarName] = "0";

return startInfo;
}
}
Expand Down

0 comments on commit 844e959

Please sign in to comment.