Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YuliiaKovalova committed Aug 24, 2023
1 parent 247c654 commit d3287fa
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/MSBuildLocator/DotNetSdkLocationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ internal static class DotNetSdkLocationHelper
private static readonly string ExeName = IsWindows ? "dotnet.exe" : "dotnet";
private static readonly string DotnetPath = ResolveDotnetPath();

static DotNetSdkLocationHelper() => LoadHostFxr();

public static VisualStudioInstance? GetInstance(string dotNetSdkPath)
{
if (string.IsNullOrWhiteSpace(dotNetSdkPath) || !File.Exists(Path.Combine(dotNetSdkPath, "Microsoft.Build.dll")))
Expand Down Expand Up @@ -81,8 +79,10 @@ public static IEnumerable<VisualStudioInstance> GetInstances(string workingDirec
}
}

public static IEnumerable<string> GetDotNetBasePaths(string workingDirectory)
private static IEnumerable<string> GetDotNetBasePaths(string workingDirectory)
{
LoadHostFxr();

string? bestSDK = GetSdkFromGlobalSettings(workingDirectory);
if (!string.IsNullOrEmpty(bestSDK))
{
Expand Down Expand Up @@ -213,16 +213,7 @@ private static string ResolveDotnetPath()
return dotnetPath;
}

private static string? GetCurrentProcessPath()
{
string? processPath = null;
#if NET6_0_OR_GREATER
processPath = Environment.ProcessPath;
#else
processPath = Process.GetCurrentProcess().MainModule.FileName;
#endif
return processPath;
}
private static string? GetCurrentProcessPath() => Environment.ProcessPath;

private static string? GetDotnetPathFromPATH()
{
Expand Down

0 comments on commit d3287fa

Please sign in to comment.