MarshalByRefObject.GetLifetimeService 方法

定义

注意

This Remoting API is not supported and throws PlatformNotSupportedException.

检索控制此实例的生存期策略的当前生存期服务对象。

C#
[System.Obsolete("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0010", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public object GetLifetimeService ();
C#
public object GetLifetimeService ();
C#
[System.Security.SecurityCritical]
public object GetLifetimeService ();

返回

Object

ILease 类型的对象,用于控制此实例的生存期策略。

属性

例外

直接调用方没有基础结构权限。

仅限 .NET Core 和 .NET 5 及更高版本:在所有情况下。

注解

从 .NET 5 开始,此方法标记为已过时。

有关生存期服务的信息,请参阅 LifetimeServices 类。

适用于

产品 版本 (已过时)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 7 (5, 6)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8
.NET Standard 2.0, 2.1