MarshalByRefObject.CreateObjRef(Type) 方法

定義

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

public:
 virtual System::Runtime::Remoting::ObjRef ^ CreateObjRef(Type ^ requestedType);
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
[System.Security.SecurityCritical]
public virtual System.Runtime.Remoting.ObjRef CreateObjRef (Type requestedType);
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
[<System.Security.SecurityCritical>]
abstract member CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
override this.CreateObjRef : Type -> System.Runtime.Remoting.ObjRef
Public Overridable Function CreateObjRef (requestedType As Type) As ObjRef

參數

requestedType
Type

物件的 Type,新的 ObjRef 將參考這個型別。The Type of the object that the new ObjRef will reference.

傳回

ObjRef

產生 Proxy 時所需要的資訊。Information required to generate a proxy.

屬性

例外狀況

這個執行個體不是有效的遠端物件。This instance is not a valid remoting object.

立即呼叫端沒有基礎結構使用權限。The immediate caller does not have infrastructure permission.

備註

CreateObjRef方法是由遠端物件建立方法(例如和)所呼叫 AppDomain.CreateInstance AppDomain.CreateInstanceAndUnwrapThe CreateObjRef method is called by remote object creation methods such as AppDomain.CreateInstance and AppDomain.CreateInstanceAndUnwrap. 在大部分情況下,不需要覆寫此方法。In most cases, there is no need to override this method.

適用於