Skip to content

Commit

Permalink
chore: Revert "chore: debug3 - DROP THIS COMMIT BEFORE MERGING"
Browse files Browse the repository at this point in the history
This reverts commit 0923ca8.
  • Loading branch information
ramezgerges committed Dec 7, 2023
1 parent a60d63b commit 223b286
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions UnoCheck/DotNet/DotNetSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ public DotNetSdk(SharedState sharedState)
if (Directory.Exists(envSdkRoot))
sdkRoot = envSdkRoot;
}

if (string.IsNullOrEmpty(sdkRoot) || !Directory.Exists(sdkRoot))

string environmentOverride = Environment.GetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR");
if (!string.IsNullOrEmpty(environmentOverride))
{
sdkRoot = Microsoft.DotNet.NativeWrapper.EnvironmentProvider.GetDotnetExeDirectory();
sdkRoot = environmentOverride;
}

if (string.IsNullOrEmpty(sdkRoot) || !Directory.Exists(sdkRoot))
{
var l = FindDotNetLocations();
Expand All @@ -83,6 +84,11 @@ public DotNetSdk(SharedState sharedState)
}
}

if (string.IsNullOrEmpty(sdkRoot) || !Directory.Exists(sdkRoot))
{
sdkRoot = Microsoft.DotNet.NativeWrapper.EnvironmentProvider.GetDotnetExeDirectory(log: (s) => Util.Log(s.ToString()));
}

sharedState.SetEnvironmentVariable("DOTNET_ROOT", sdkRoot);

// First try and use the actual resolver logic
Expand Down

0 comments on commit 223b286

Please sign in to comment.