Microsoft Application Block for .NET - Exception

Microsoft Application Block for .NET

- Exception

  1. 工作流

The flow of logic when the Exception Management Application Block is used to publish an exception illustrated in the preceding diagram is as follows:

1)      The application throws an exception, which can be derived from the BaseApplicationException class provided in the Exception Management Application Block.

2)      The application calls the Publish method of the ExceptionManager class.

3)      The ExceptionManager class uses the ExceptionManagerSectionHandler class to retrieve the application’s exception management settings.

4)      The exception management settings in the application’s configuration file (if any) are read to determine how the exception should be published.

5)      If no settings are found, the exception is published in the Windows Event Log by using the DefaultPublisher class. If the application has exception management settings configured, the publishers listed in the configuration file, which can include the DefaultPublisher class and custom publisher classes, are used to publish the exception. All publishers implement at least one of the interfaces defined in the Interfaces assembly.

6)      If an exception occurs while publishing through a custom publisher, the exception manager raises a CustomPublisherException, and uses the default publisher to publish it in the Windows Event Log.

 

  1. Cache 的主要接口

·        IExceptionPublisher

例外发布器,Exception Framework提供的有:DefaultPublisher(发布到系统的事件日志)

·        IExceptionXmlPublisher

 

  1. 主要类

ExceptionManager

 

  1. 配置文件

主要对使用的例外发布器进行配置。

 

 

  1. 调用方法

ExceptionManager.Publish(Exception, additionalInfo);

 

  1. 其他

为确保你的OS的事件日志功能已启动,你应该使用ExceptionManagerInstaller类在安装时去安装它

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值