MarshalByRefObject.CreateObjRef(Type) 方法

定義

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。

C#
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
C#
[System.Security.SecurityCritical]
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);

參數

requestedType
Type

物件的 Type,新的 ObjRef 將參考這個型別。

傳回

ObjRef

產生 Proxy 時所需要的資訊。

屬性

例外狀況

這個執行個體不是有效的遠端物件。

立即呼叫端沒有基礎結構使用權限。

備註

CreateObjRef方法是由遠端物件建立方法(例如和) AppDomain.CreateInstance 呼叫 AppDomain.CreateInstanceAndUnwrap 。 在大部分情況下,不需要覆寫這個方法。

適用於

產品 版本
.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