Skip to content

Commit 1dc4b2b

Browse files
author
msftbot[bot]
authored
Merge pull request #41744 from dotnet/merges/master-to-master-vs-deps
Merge master to master-vs-deps
2 parents dd5f35c + 7b6c485 commit 1dc4b2b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Compilers/Shared/RuntimeHostInfo.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
using System;
88
using System.Diagnostics;
99
using System.Diagnostics.CodeAnalysis;
10+
using System.IO;
1011
using System.IO.Pipes;
12+
using Roslyn.Utilities;
1113

1214
namespace Microsoft.CodeAnalysis
1315
{
@@ -20,6 +22,7 @@ internal static class RuntimeHostInfo
2022
internal static bool IsCoreClrRuntime => !IsDesktopRuntime;
2123

2224
internal static string ToolExtension => IsCoreClrRuntime ? "dll" : "exe";
25+
private static string NativeToolSuffix => PlatformInformation.IsWindows ? ".exe" : "";
2326

2427
/// <summary>
2528
/// This gets information about invoking a tool on the current runtime. This will attempt to
@@ -29,6 +32,11 @@ internal static (string processFilePath, string commandLineArguments, string too
2932
{
3033
Debug.Assert(!toolFilePathWithoutExtension.EndsWith(".dll") && !toolFilePathWithoutExtension.EndsWith(".exe"));
3134

35+
var nativeToolFilePath = $"{toolFilePathWithoutExtension}{NativeToolSuffix}";
36+
if (IsCoreClrRuntime && File.Exists(nativeToolFilePath))
37+
{
38+
return (nativeToolFilePath, commandLineArguments, nativeToolFilePath);
39+
}
3240
var toolFilePath = $"{toolFilePathWithoutExtension}.{ToolExtension}";
3341
if (IsDotNetHost(out string? pathToDotNet))
3442
{

0 commit comments

Comments
 (0)