InvalidOperationException-无法构造LogWriter类型。您必须配置容器以提供此值

时间:2019-04-04 07:52:27

标签: logging .net-4.0 enterprise-library enterprise-library-5 biztalk-2016

当我尝试从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和{ {1}},引用了BTSNTSvc64.exe.config文件。我正在使用BizTalk 2016和VS2015。

我正在尝试将文本记录在纯文本文件中。

1 个答案:

答案 0 :(得分:0)

有一个有关此问题的msdn论坛主题。 https://social.msdn.microsoft.com/Forums/en-US/8edb589c-a488-49ec-aca7-5c5219940fbb/biztalk-enterprise-library-logging-issue?forum=biztalkgeneral

不确定为什么要尝试使用Enterprise库将日志跟踪到文本文件。 ETW是为此目的推荐的高性能仪器。请参阅文章https://social.technet.microsoft.com/wiki/contents/articles/30523.biztalk-server-2013-r2-instrumenting-an-orchestration-with-etw.aspx