SolutionServices.GetRequiredService<TWorkspaceService> 方法

定义

获取由服务类型标识的主机提供的特定于工作区的服务。 如果主机未提供服务,此方法将 InvalidOperationException引发 。

public TWorkspaceService GetRequiredService<TWorkspaceService> () where TWorkspaceService : Microsoft.CodeAnalysis.Host.IWorkspaceService;
member this.GetRequiredService : unit -> 'WorkspaceService (requires 'WorkspaceService :> Microsoft.CodeAnalysis.Host.IWorkspaceService)
Public Function GetRequiredService(Of TWorkspaceService As IWorkspaceService) () As TWorkspaceService

类型参数

TWorkspaceService

返回

TWorkspaceService

适用于