MarshalByRefObject.GetLifetimeService 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
This Remoting API is not supported and throws PlatformNotSupportedException.
擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。
public:
System::Object ^ GetLifetimeService();
public:
virtual System::Object ^ GetLifetimeService();
[System.Obsolete("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0010", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public object GetLifetimeService ();
public object GetLifetimeService ();
[System.Security.SecurityCritical]
public object GetLifetimeService ();
[<System.Obsolete("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId="SYSLIB0010", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.GetLifetimeService : unit -> obj
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
傳回
型別 ILease 的物件,用來控制這個執行個體的存留期原則。
- 屬性
例外狀況
立即呼叫端沒有基礎結構使用權限。
僅限 .NET Core 與 .NET 5+:在所有情況下。
備註
從 .NET 5 開始,這個方法會標示為過時。
如需有關存留期服務的詳細資訊,請參閱 LifetimeServices 類別。