ChannelDispatcher.ErrorHandlers Property

 
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.

Gets a set of IErrorHandler objects that can be used to insert custom error handling functionality for an endpoint.

Namespace:   System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public Collection<IErrorHandler> ErrorHandlers { get; }

Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

serviceHost.Open();

ChannelDispatcher dispatcher = (ChannelDispatcher)serviceHost.ChannelDispatchers[0];
Collection<IErrorHandler> col = dispatcher.ErrorHandlers;

.NET Framework
Available since 3.0
Return to top
Show: