未验证 提交 7b6c485e 编写于 作者: A Ashley Hauck 提交者: GitHub

Support VBCSCompiler being compiled with --self-contained (or equivalent) (#41650)

上级 134b2172
......@@ -7,7 +7,9 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Pipes;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis
{
......@@ -20,6 +22,7 @@ internal static class RuntimeHostInfo
internal static bool IsCoreClrRuntime => !IsDesktopRuntime;
internal static string ToolExtension => IsCoreClrRuntime ? "dll" : "exe";
private static string NativeToolSuffix => PlatformInformation.IsWindows ? ".exe" : "";
/// <summary>
/// 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
{
Debug.Assert(!toolFilePathWithoutExtension.EndsWith(".dll") && !toolFilePathWithoutExtension.EndsWith(".exe"));
var nativeToolFilePath = $"{toolFilePathWithoutExtension}{NativeToolSuffix}";
if (IsCoreClrRuntime && File.Exists(nativeToolFilePath))
{
return (nativeToolFilePath, commandLineArguments, nativeToolFilePath);
}
var toolFilePath = $"{toolFilePathWithoutExtension}.{ToolExtension}";
if (IsDotNetHost(out string? pathToDotNet))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册