エンタープライズ ライブラリ 4.1 の IExceptionHandler を実装する必要があります。私の特定のケースでは、それを使用して例外を Fogbugz に記録したいのですが、内部の詳細は私が求めているものではありません。私が必要とするのは、方法 - ベスト プラクティス - 実装、app.config または web.config の構成を取得する方法です。等
私はこれまでのところコードを持っています:
public class LcpFogbugzExceptionHandler : IExceptionHandler {
/// <summary>
/// Initializes a new instance of the <see cref="LcpFogbugzExceptionHandler"/> class.
/// </summary>
public LcpFogbugzExceptionHandler() {
// <param name="ignore">The ignore.</param>
//NameValueCollection ignore
}
/// <summary>
/// Initializes a new instance of the <see cref="T:LcpFogbugzExceptionHandler"/> class.
/// </summary>
/// <param name="ignore">The ignore.</param>
public LcpFogbugzExceptionHandler(NameValueCollection ignore) {
}
/// <summary>
/// Handles the exception.
/// </summary>
/// <param name="exception">The exception.</param>
/// <param name="handlingInstanceId">The handling instance id.</param>
/// <returns></returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1300:SpecifyMessageBoxOptions"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.Convert.ToBoolean(System.String)")]
public Exception HandleException(Exception exception, Guid handlingInstanceId) {
// Perform processing here. The exception returned will be passed to the next
// exception handler in the chain.
return exception;
}
}