[Enterprise Library]调用Enterprise Library时出现的错误事件之关闭办法
[Enterprise Library]调用Enterprise Library时出现的错误事件之关闭办法
编写者:
问题:
安装完“Microsoft patterns & practices Enterprise Library”之后,调用它的库时,经常会在事件查看器中看到类似于下面的错误报告:
事件类型: 错误 事件来源: 事件种类: 无 事件 ID: 0 描述: Failed to create instances of performance counter 'Cache Total Turnover Rate' - 请求的性能计数器不是自定义计数器,它必须初始化为只读。. 有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。 |
或者
事件类型: 错误 事件来源: 事件种类: 无 事件 ID: 0 描述: Failed to create instances of performance counter 'Total Cache Entries' - 请求的性能计数器不是自定义计数器,它必须初始化为只读。. 有关更多信息,请参阅在 http://go.microsoft.com/fwlink/events.asp 的帮助和支持中心。 |
等等。
解决之道就是:
运行X:\Program Files\Microsoft Enterprise Library\src文件夹下的InstallServices.bat。
它会安排好它所需要的性能计数器,如它会在安装“Logging and Instrumentation Application Block”时,
正在安装 WMI 架构:已开始 正在安装 WMI 架构:已完成 正在日志 Application 中创建 EventLog 源 Enterprise Library Logging Service... 正在日志 Application 中创建 EventLog 源 Enterprise Library Backup Sink... 正在日志 Application 中创建 EventLog 源 Enterprise Library Distributor Service.. . 正在创建性能计数器类别 Enterprise Library Logging Service。 |
运行过之后,再次调用库,就不会出现这些错误事件了。
编写者: