LanguageServices.GetRequiredService<TLanguageService> 方法

定义

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

public TLanguageService GetRequiredService<TLanguageService> () where TLanguageService : Microsoft.CodeAnalysis.Host.ILanguageService;
member this.GetRequiredService : unit -> 'LanguageService (requires 'LanguageService :> Microsoft.CodeAnalysis.Host.ILanguageService)
Public Function GetRequiredService(Of TLanguageService As ILanguageService) () As TLanguageService

类型参数

TLanguageService

返回

TLanguageService

适用于