public Task <string?> TryGetServiceNameAsync(CancellationToken cancellationToken) { if (!RemoteHostOptions.IsUsingServiceHubOutOfProcess(_workspace.Services)) { return(SpecializedTasks.Null <string>()); } var isRemoteHost64Bit = RemoteHostOptions.IsServiceHubProcess64Bit(_workspace.Services); return(Task.FromResult <string?>(new RemoteServiceName(WellKnownServiceHubService.CodeAnalysis).ToString(isRemoteHost64Bit))); }
public override RemoteServiceConnection <T> CreateConnection <T>(object?callbackTarget) where T : class { var descriptor = ServiceDescriptors.Instance.GetServiceDescriptor(typeof(T), isRemoteHostServerGC: GCSettings.IsServerGC, isRemoteHostCoreClr: RemoteHostOptions.IsCurrentProcessRunningOnCoreClr()); var callbackDispatcher = (descriptor.ClientInterface != null) ? _callbackDispatchers.GetDispatcher(typeof(T)) : null; return(new BrokeredServiceConnection <T>( descriptor, callbackTarget, callbackDispatcher, _inprocServices.ServiceBrokerClient, _workspaceServices.GetRequiredService <ISolutionAssetStorageProvider>().AssetStorage, _workspaceServices.GetRequiredService <IErrorReportingService>(), shutdownCancellationService: null)); }