RemotingServices.IsObjectOutOfAppDomain Method (Object)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a Boolean value that indicates whether the object specified by the given transparent proxy is contained in a different application domain than the object that called the current method.

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

Public Shared Function IsObjectOutOfAppDomain (
	tp As Object
) As Boolean

Parameters

tp
Type: System.Object

The object to check.

Return Value

Type: System.Boolean

true if the object is out of the current application domain; otherwise, false.

For information about application domains, see Application Domains.

' Create remote version of TempConverter.Converter.
Dim converter1 As TempConverter.Converter

converter1 = CType(Activator.GetObject(GetType( _
                     TempConverter.Converter), _
                     "http://localhost:8085/TempConverter"), _
                     TempConverter.Converter)
' Create local version of TempConverter.Converter.
Dim converter2 As New TempConverter.Converter()

' Returns true, converter1 is remote and in a different appdomain.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain( _
                                                   converter1)

' Returns false, converter2 is local and running in this appdomain.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfAppDomain( _
                                                   converter2)

' Returns true, converter1 is remote and in a different context.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfContext( _
                                                   converter1)

' Returns false, converter2 is local and running in this context.
System.Runtime.Remoting.RemotingServices.IsObjectOutOfContext( _
                                                   converter2)

.NET Framework
Available since 1.1
Return to top
Show: