This documentation is archived and is not being maintained.

RemotingServices.GetObjectUri Method

Retrieves the URI for the specified object.

[Visual Basic]
Public Shared Function GetObjectUri( _
   ByVal obj As MarshalByRefObject _
) As String
public static string GetObjectUri(
 MarshalByRefObject obj
public: static String* GetObjectUri(
 MarshalByRefObject* obj
public static function GetObjectUri(
   obj : MarshalByRefObject
) : String;


The MarshalByRefObject for which a URI is requested.

Return Value

The URI of the specified object if it has one, or a null reference (Nothing in Visual Basic) if the object has not yet been marshaled.


Exception Type Condition
SecurityException The immediate caller does not have infrastructure permission.


[Visual Basic] 
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

RealProxy proxy = RemotingServices.GetRealProxy(obj);
Console.WriteLine("Real proxy type: {0}", proxy.GetProxiedType().ToString());

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

IMessageSink  msgSink = RemotingServices.GetEnvoyChainForProxy(obj).NextSink;

RealProxy* proxy = RemotingServices::GetRealProxy(obj);
Console::WriteLine(S"Real proxy type: {0}", proxy->GetProxiedType());

Console::WriteLine(S"Object URI: {0}", RemotingServices::GetObjectUri(obj));

IMessageSink* msgSink = RemotingServices::GetEnvoyChainForProxy(obj)->NextSink;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

RemotingServices Class | RemotingServices Members | System.Runtime.Remoting Namespace