MarshalByRefObject.GetLifetimeService 方法

定义

检索控制此实例的生存期策略的当前生存期服务对象。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

public:
 System::Object ^ GetLifetimeService();
public:
 virtual System::Object ^ GetLifetimeService();
public object GetLifetimeService ();
[System.Security.SecurityCritical]
public object GetLifetimeService ();
member this.GetLifetimeService : unit -> obj
abstract member GetLifetimeService : unit -> obj
override this.GetLifetimeService : unit -> obj
[<System.Security.SecurityCritical>]
abstract member GetLifetimeService : unit -> obj
override this.GetLifetimeService : unit -> obj
Public Function GetLifetimeService () As Object

返回

Object

ILease 类型的对象,用于控制此实例的生存期策略。An object of type ILease used to control the lifetime policy for this instance.

属性

例外

直接调用方没有基础结构权限。The immediate caller does not have infrastructure permission.

仅限 .NET Core 和 .NET 5 及更高版本:在所有情况下。.NET Core and .NET 5+ only: In all cases.

注解

从 .NET 5.0 开始,此方法标记为已过时。This method is marked obsolete starting in .NET 5.0.

有关生存期服务的详细信息,请参阅 LifetimeServices 类。For more information about lifetime services, see the LifetimeServices class.

适用于