diff --git a/src/Shared/FrameworkLocationHelper.cs b/src/Shared/FrameworkLocationHelper.cs index 8901b0def29..b0b620ad68a 100644 --- a/src/Shared/FrameworkLocationHelper.cs +++ b/src/Shared/FrameworkLocationHelper.cs @@ -1392,8 +1392,8 @@ public virtual string GetPathToDotNetFramework(DotNetFrameworkArchitecture archi // Context: https://github.com/dotnet/msbuild/pull/7689 if (this._hasMsBuild && generatedPathToDotNetFramework != null && - (!FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && - !FileSystems.Default.FileExists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) + (!File.Exists(Path.Combine(generatedPathToDotNetFramework, NativeMethodsShared.IsWindows ? "MSBuild.exe" : "mcs.exe")) && + !File.Exists(Path.Combine(generatedPathToDotNetFramework, "Microsoft.Build.dll")))) { return null; } diff --git a/src/Utilities/ToolLocationHelper.cs b/src/Utilities/ToolLocationHelper.cs index 76198ed413a..0d45b676cd8 100644 --- a/src/Utilities/ToolLocationHelper.cs +++ b/src/Utilities/ToolLocationHelper.cs @@ -3584,7 +3584,7 @@ public static string GetPathToBuildToolsFile(string fileName, string toolsVersio { toolPath = Path.Combine(toolPath, fileName); - if (!FileSystems.Default.FileExists(toolPath)) + if (!File.Exists(toolPath)) { toolPath = null; }