logging - InvalidOperationException - 无法构造类型 LogWriter。您必须配置容器以提供此值
问题描述
当我尝试从 BizTalk 业务流程中记录某些内容时,我在事件日志中收到以下错误消息。
Error using Info(System.String,System.String): Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter", name = "(none)".
Exception occurred while: while resolving.
Exception is: InvalidOperationException - The type LogWriter cannot be constructed. You must configure the container to supply this value.
-----------------------------------------------
At the time of the exception, the container was:
Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter,(none)
Inner exception: The type LogWriter cannot be constructed. You must configure the container to supply this value.
为了登录 BizTalk 业务流程,我创建了一个使用 Microsoft Enterprise Library 5 的自定义 .net 组件。Entlib 日志记录的配置位于专用文件中,并且来自 BizTalk 配置文件,BTSNTSvc.exe.config
并且引用BTSNTSvc64.exe.config
了该entlib.config
文件。我正在使用 BizTalk 2016 和 VS2015。
我正在尝试在平面文本文件中记录文本。
解决方案
有一个关于这个问题的 msdn 论坛主题。https://social.msdn.microsoft.com/Forums/en-US/8edb589c-a488-49ec-aca7-5c5219940fbb/biztalk-enterprise-library-logging-issue?forum=biztalkgeneral
不确定您为什么要尝试使用企业库将日志跟踪到文本文件。ETW 是为此目的而推荐的高性能仪器。请参阅文章https://social.technet.microsoft.com/wiki/contents/articles/30523.biztalk-server-2013-r2-instrumenting-an-orchestration-with-etw.aspx。
推荐阅读
- php - 一旦网站在joomla中关闭,如何重定向页面
- amazon-web-services - 为什么 S3 文件上传不会触发 SNS 主题的事件?
- mysql - 无法访问子查询内连接中的超级查询列
- swift - 如何增加场景中的照明?
- ios - 如何解决安装cocoapods的文件权限错误
- php - PHP - FILTER_SANITIZE_ENCODED 无法正常工作
- ruby-on-rails - # < Mail::Part - Ruby 的未定义方法“high_chart”
- vue.js - Vue.js 打开和关闭汉堡菜单
- android - 数据绑定无法获取视图的高度
- c# - DataGrid 过滤、多输入、MVVM、C#