MarshalByRefObject.GetLifetimeService 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
警告
This Remoting API is not supported and throws PlatformNotSupportedException.
擷取控制這個實例存留期原則的目前存留期服務物件。
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