MarshalByRefObject.GetLifetimeService 方法

定義

警告

This Remoting API is not supported and throws PlatformNotSupportedException.

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。

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