gle*_*ron 6 configuration logging enterprise-library msmq
我正在尝试使用 Enterprise Library MSMQ Distributor 服务来获取放置在 MSMQ 队列中的日志消息,并通过 Logging 块的标准数据库部分将它们放置在数据库中。
但是,当我尝试启动 Distributor 服务时,出现以下异常:
Exception Type: System.Configuration.ConfigurationErrorsException
Message: Invalid TraceListenerData type in configuration 'listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database"'. (C:\Projects\LogTest\msmqDistributor\MsmqDistributor.exe.Config line 15)
Run Code Online (Sandbox Code Playgroud)
有问题的行看起来像这样:
<listeners>
<add name="Database Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database"
databaseInstanceName="LoggingDB" writeLogStoredProcName="WriteLog"
addCategoryStoredProcName="AddCategory" formatter="Text Formatter"
traceOutputOptions="DateTime, Timestamp" />
<!-- other listeners -->
</listeners>
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚侦听器定义有什么问题 - 似乎分发服务器找不到它,但据我所知,相关的 dll 位于同一文件夹中。针对不同的应用程序运行相同的配置可以正常工作并将日志条目写入数据库,因此似乎这可能与服务权限有关,但我不知道我需要通过哪种方式查找此权限。
此问题归结为可用的 .dll 版本错误。如果您同时拥有 Enterprise Library 的源版本和二进制版本,则需要确保使用与用于创建配置文件的 EntLibConfig.exe 版本相同的库。因此,如果您使用二进制发行版中的 EntLibConfig 文件,则需要使二进制发行版中的 dll 可用于由它们配置的应用程序。否则你的所有引用都会混乱,并且你会得到这种类型的错误。
| 归档时间: |
|
| 查看次数: |
9585 次 |
| 最近记录: |