This documentation is archived and is not being maintained.

RemotingServices.IsObjectOutOfContext Method

Returns a Boolean value that indicates whether the object represented by the given proxy is contained in a different context than the object that called the current method.

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

public static bool IsObjectOutOfContext(
	Object tp


Type: System.Object
The object to check.

Return Value

Type: System.Boolean
true if the object is out of the current context; otherwise, false.

A context is an ordered sequence of properties that define an environment for the objects that reside inside it. Contexts are created during the activation process for objects that are configured to require certain automatic services such synchronization, transactions, just-in-time activation, security, and so on. Multiple objects can live inside a context.

			// Create a remote version of TempConverter.Converter.
			TempConverter.Converter converter1 =
					(TempConverter.Converter) Activator.GetObject(
			// Create a local version of TempConverter.Converter.
			TempConverter.Converter converter2 = new TempConverter.Converter();

			// Returns true, converter1 is remote and in a different appdomain.

			// Returns false, converter2 is local and running in this appdomain.

			// Returns true, converter1 is remote and in a different context.

			// Returns false, converter2 is local and running in this context.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.