ISupportRequiredService.GetRequiredService(Type) 方法

定义

从实现此接口的 获取 IServiceProvider 类型的serviceType服务。

public:
 System::Object ^ GetRequiredService(Type ^ serviceType);
public object GetRequiredService (Type serviceType);
abstract member GetRequiredService : Type -> obj
Public Function GetRequiredService (serviceType As Type) As Object

参数

serviceType
Type

要获取的服务对象的类型。

返回

serviceType 类型的服务对象。 如果 IServiceProvider 无法创建该对象,则会引发异常。

例外

provider 已被释放。

适用于