RemotingServices.GetObjectUri Method (MarshalByRefObject)


Retrieves the URI for the specified object.

Namespace:   System.Runtime.Remoting
Assembly:  mscorlib (in mscorlib.dll)

Public Shared Function GetObjectUri (
	obj As MarshalByRefObject
) As String


Type: System.MarshalByRefObject

The MarshalByRefObject for which a URI is requested.

Return Value

Type: System.String

The URI of the specified object if it has one, or null if the object has not yet been marshaled.

Exception Condition

The immediate caller does not have infrastructure permission.

' GetRealProxy, GetObjectUri, GetEnvoyChainForProxy
Dim proxy As RealProxy = RemotingServices.GetRealProxy(obj)
Console.WriteLine("Real proxy type: {0}", proxy.GetProxiedType().ToString())

Console.WriteLine("Object URI: {0}", RemotingServices.GetObjectUri(obj).ToString())

Dim msgSink As IMessageSink = RemotingServices.GetEnvoyChainForProxy(obj).NextSink


for operating with infrastructure code. Demand value: SecurityAction.LinkDemand; Permission value: SecurityPermissionFlag.Infrastructure

.NET Framework
Available since 1.1
Return to top