gpt4 book ai didi

asp.net-mvc - 尝试获取 LogWriter 类型的实例时发生激活错误, key ""

转载 作者:行者123 更新时间:2023-12-02 20:19:18 24 4
gpt4 key购买 nike

我在登录事件查看器时收到此错误。我正在事件查看器以及滚动平面文件中查找异常。如果我删除事件查看器部分,则滚动平面文件可以正常工作,但只有当我添加此部分时,它才会出现异常

{"Resolution of the dependency failed, type = \"Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter\", name = \"(none)\".\r\nException occurred while: while resolving.\r\nException is: InvalidOperationException - The type TraceListener cannot be constructed. You must configure the container to supply this value.\r\n-----------------------------------------------\r\nAt the time of the exception, the container was:\r\n\r\n Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl,LogWriter.default (mapped from Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter, (none))\r\n Resolving parameter \"structureHolder\" of constructor Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterImpl(Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder structureHolder, Microsoft.Practices.EnterpriseLibrary.Logging.Instrumentation.ILoggingInstrumentationProvider instrumentationProvider, Microsoft.Practices.EnterpriseLibrary.Logging.ILoggingUpdateCoordinator updateCoordinator)\r\n Resolving Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder,LogWriterStructureHolder.default (mapped from Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder, (none))\r\n Resolving parameter \"traceSources\" of constructor Microsoft.Practices.EnterpriseLibrary.Logging.LogWriterStructureHolder(System.Collections.Generic.IEnumerable1[[Microsoft.Practices.EnterpriseLibrary.Logging.Filters.ILogFilter,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35]] filters,
System.Collections.Generic.IEnumerable
1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] traceSourceNames, System.Collections.Generic.IEnumerable1[[Microsoft.Practices.EnterpriseLibrary.Logging.LogSource,
Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35]] traceSources,
Microsoft.Practices.EnterpriseLibrary.Logging.LogSource
allEventsTraceSource,
Microsoft.Practices.EnterpriseLibrary.Logging.LogSource
notProcessedTraceSource,
Microsoft.Practices.EnterpriseLibrary.Logging.LogSource
errorsTraceSource, System.String defaultCategory, System.Boolean
tracingEnabled, System.Boolean logWarningsWhenNoCategoriesMatch,
System.Boolean revertImpersonation)\r\n Resolving
Microsoft.Practices.EnterpriseLibrary.Logging.LogSource,General\r\n<br/>
Resolving parameter \"traceListeners\" of constructor
Microsoft.Practices.EnterpriseLibrary.Logging.LogSource(System.String
name,
System.Collections.Generic.IEnumerable
1[[System.Diagnostics.TraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] traceListeners, System.Diagnostics.SourceLevels level, System.Boolean autoFlush, Microsoft.Practices.EnterpriseLibrary.Logging.Instrumentation.ILoggingInstrumentationProvider instrumentationProvider)\r\n Resolving System.Diagnostics.TraceListener,Event Log Trace Listener\r\n"}

最佳答案

我遇到了同样的问题,这是由于我的配置文件中的错误造成的。我从我的categorySources 部分引用了跟踪监听器,该监听器在我的监听器部分中不存在。我删除了类别和映射(反正我没有使用它们),然后它就起作用了。我想你可以在配置控制台中验证你的配置文件,然后它会告诉你问题是什么。

关于asp.net-mvc - 尝试获取 LogWriter 类型的实例时发生激活错误, key "",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6189154/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com