This topic has not yet been rated - Rate this topic

InstanceContext.Extensions Property

Gets the extension collection, if any, associated with the service instance.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

public IExtensionCollection<InstanceContext> Extensions { get; }
/** @property */
public final IExtensionCollection<InstanceContext> get_Extensions ()

public final function get Extensions () : IExtensionCollection<InstanceContext>

Not applicable.

Property Value

The IExtensionCollection of type InstanceContext that contains the instance contexts for the extensions of the service instance.
Exception typeCondition

ObjectDisposedException

The service instance associated with this context is closed, but was not aborted.

CommunicationObjectFaultedException

The service instance associated with this context is in a faulted state.

The following code shows how to access the Extensions property:

Uri baseAddress = new Uri("http://localhost:8000/ServiceModelSamples/service");
CalculatorService service = new CalculatorService();
ServiceHost serviceHost = new ServiceHost(service, baseAddress);
InstanceContext instanceContext = new InstanceContext(serviceHost, service);

IExtensionCollection<InstanceContext> extensions = instanceContext.Extensions;

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.