Enterprise Library 6.0 を使用すると、次のコードでこのエラーが発生します。
bool rethrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy1")
「SetExceptionManager メソッドを使用して、ExceptionPolicy クラスに ExceptionManager を設定する必要があります。」
Enterprise Library 5.0 では、次のコードが機能しました。
public static bool HandleException(Exception exception, string PolicyName)
{
ExceptionManager exManager = EnterpriseLibraryContainer.Current.GetInstance<ExceptionManager>();
ExceptionPolicy.SetExceptionManager(exManager);
bool rethrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy1");
return reThrow;
}
しかし、Enterprise Library 6.0 では EnterpriseLibraryContainer クラスが見つかりません。ExceptionManager のインスタンスを取得したい。この問題を解決するにはどうすればよいですか?