Skip to content

Commit 36f07b2

Browse files
author
msftbot[bot]
authored
Merge pull request #41621 from dotnet/merges/release/dev16.5-to-release/dev16.5-vs-deps
Merge release/dev16.5 to release/dev16.5-vs-deps
2 parents 0d99ae6 + d06542a commit 36f07b2

File tree

6 files changed

+18
-5
lines changed

6 files changed

+18
-5
lines changed

src/EditorFeatures/TestUtilities/Remote/InProcRemostHostClient.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Microsoft.CodeAnalysis;
1515
using Microsoft.CodeAnalysis.Remote;
1616
using Microsoft.CodeAnalysis.Remote.Services;
17+
using Microsoft.CodeAnalysis.Test.Utilities.RemoteHost;
1718
using Microsoft.VisualStudio.LanguageServices.Remote;
1819
using Nerdbank;
1920
using Roslyn.Utilities;
@@ -90,6 +91,7 @@ public Task<Stream> RequestServiceAsync(string serviceName)
9091
}
9192

9293
public override string ClientId { get; }
94+
public override bool IsRemoteHost64Bit => IntPtr.Size == 8;
9395

9496
public override async Task<Connection?> TryCreateConnectionAsync(
9597
string serviceName, object? callbackTarget, CancellationToken cancellationToken)

src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostClientServiceFactory.RemoteHostClientService.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,7 @@ bool IRemoteHostClientService.IsEnabled()
190190

191191
private void SetRemoteHostBitness()
192192
{
193-
var x64 = _workspace.Options.GetOption(RemoteHostOptions.OOP64Bit);
194-
if (!x64)
195-
{
196-
x64 = _workspace.Services.GetRequiredService<IExperimentationService>().IsExperimentEnabled(WellKnownExperimentNames.RoslynOOP64bit);
197-
}
193+
bool x64 = RemoteHostOptions.IsServiceHubProcess64Bit(_workspace);
198194

199195
// log OOP bitness
200196
Logger.Log(FunctionId.RemoteHost_Bitness, KeyValueLogMessage.Create(LogType.Trace, m => m["64bit"] = x64));

src/VisualStudio/Core/Def/Implementation/Remote/RemoteHostOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
using System.Collections.Immutable;
66
using System.Composition;
7+
using Microsoft.CodeAnalysis;
78
using Microsoft.CodeAnalysis.Editor.Shared.Options;
9+
using Microsoft.CodeAnalysis.Experiments;
810
using Microsoft.CodeAnalysis.Options;
911
using Microsoft.CodeAnalysis.Options.Providers;
1012

@@ -53,6 +55,10 @@ internal static class RemoteHostOptions
5355
public static readonly Option<int> MaxPoolConnection = new Option<int>(
5456
nameof(InternalFeatureOnOffOptions), nameof(MaxPoolConnection), defaultValue: 15,
5557
storageLocations: new LocalUserProfileStorageLocation(InternalFeatureOnOffOptions.LocalRegistryPath + nameof(MaxPoolConnection)));
58+
59+
public static bool IsServiceHubProcess64Bit(Workspace workspace)
60+
=> workspace.Options.GetOption(OOP64Bit) ||
61+
workspace.Services.GetRequiredService<IExperimentationService>().IsExperimentEnabled(WellKnownExperimentNames.RoslynOOP64bit);
5662
}
5763

5864
[ExportOptionProvider, Shared]

src/VisualStudio/Core/Def/Implementation/Remote/ServiceHubRemoteHostClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ static bool ReportNonFatalWatson(Exception e, CancellationToken cancellationToke
160160
}
161161

162162
public override string ClientId => _connectionManager.HostGroup.Id;
163+
public override bool IsRemoteHost64Bit => RemoteHostOptions.IsServiceHubProcess64Bit(Workspace);
163164

164165
public override Task<Connection?> TryCreateConnectionAsync(string serviceName, object? callbackTarget, CancellationToken cancellationToken)
165166
{

src/Workspaces/Core/Portable/ExternalAccess/Pythia/Api/PythiaRemoteHostClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public static async Task<Optional<T>> TryRunRemoteAsync<T>(Workspace workspace,
2222
return default;
2323
}
2424

25+
if (client.IsRemoteHost64Bit)
26+
{
27+
serviceName += "64";
28+
}
29+
2530
using var connection = await client.TryCreateConnectionAsync(serviceName, callbackTarget: null, cancellationToken).ConfigureAwait(false);
2631
if (connection == null)
2732
{

src/Workspaces/Core/Portable/Remote/RemoteHostClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ protected RemoteHostClient(Workspace workspace)
4646
/// </summary>
4747
public abstract Task<Connection?> TryCreateConnectionAsync(string serviceName, object? callbackTarget, CancellationToken cancellationToken);
4848

49+
public abstract bool IsRemoteHost64Bit { get; }
50+
4951
protected abstract void OnStarted();
5052

5153
protected void Started()
@@ -184,6 +186,7 @@ public NoOpClient(Workspace workspace)
184186
}
185187

186188
public override string ClientId => nameof(NoOpClient);
189+
public override bool IsRemoteHost64Bit => false;
187190

188191
public override Task<Connection?> TryCreateConnectionAsync(string serviceName, object? callbackTarget, CancellationToken cancellationToken)
189192
{

0 commit comments

Comments
 (0)