共用方式為


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

適用於