ChannelDispatcher.IncludeExceptionDetailInFaults プロパティ

定義

例外に関する詳細をエラーに含めるかどうかを示す値を、取得または設定します。

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

プロパティ値

例外に関する詳細をエラーに含める場合は true。それ以外の場合は false

例外

通信オブジェクトは、Opening または Opened 状態にあります。

通信オブジェクトは、Closing または Closed 状態にあります。

通信オブジェクトは、Faulted 状態にあります。

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

注釈

このプロパティは、ChannelDispatcher のインスタンスが Created 状態のときにのみ設定可能です。これは、この状態が変更可能で、かつ破棄されていない唯一の状態であるためです。

適用対象