Прочетете на английски Редактиране

Споделяне чрез


ChannelDispatcher.ErrorHandlers Property

Definition

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

C#
public System.Collections.ObjectModel.Collection<System.ServiceModel.Dispatcher.IErrorHandler> ErrorHandlers { get; }

Property Value

A SynchronizedCollection<T> of IErrorHandler objects.

Examples

C#
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;

Applies to

Продукт Версии
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1