Aracılığıyla paylaş


ChannelDispatcher.IncludeExceptionDetailInFaults Özellik

Tanım

Hatadaki bir özel durumla ilgili ayrıntıların eklenip eklenmeyeceğini belirten bir değer alır veya ayarlar.

public:
 property bool IncludeExceptionDetailInFaults { bool get(); void set(bool value); };
public bool IncludeExceptionDetailInFaults { get; set; }
member this.IncludeExceptionDetailInFaults : bool with get, set
Public Property IncludeExceptionDetailInFaults As Boolean

Özellik Değeri

true hatalara bir özel durumla ilgili ayrıntılar dahil edilirse; aksi takdirde , false.

Özel durumlar

İletişim nesnesi veya OpeningOpened durumunda.

İletişim nesnesi veya ClosingClosed durumunda.

İletişim nesnesi bir Faulted durumda.

Örnekler

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

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

serviceHost.Open();

IChannelListener icl = serviceHost.ChannelDispatchers[0].Listener;
ChannelDispatcher dispatcher = new ChannelDispatcher(icl);
dispatcher.IncludeExceptionDetailInFaults = true;
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

serviceHost.Open()

Dim icl As IChannelListener = serviceHost.ChannelDispatchers(0).Listener
Dim dispatcher As New ChannelDispatcher(icl)
dispatcher.IncludeExceptionDetailInFaults = True

Açıklamalar

Hem değiştirilebilir hem de atılmayan ChannelDispatcher tek durum olduğundan Created , bu özellik yalnızca örneği durumunda olduğunda ayarlanabilir.

Şunlara uygulanır