大佬教程收集整理的这篇文章主要介绍了asp.net-mvc – NLog在所有aspnet布局渲染器上抛出配置异常,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在configSections块中:
<section name="nlog" type="NLog.Config.ConfigSectionHandler,NLog"/>
Nlog块:
<nlog xmlns="http://www.nlog-project.org/scheR_796_11845@as/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLscheR_796_11845@a-instance" throwExceptions="true"> <variable name="logDirectory" value="C:\Logs" /> <targets> <target name="logFile" xsi:type="File" filename="${logDirectory}\app.log" layout="${aspnet-user-identity}" /> </targets> <rules> <logger name="*" minlevel="Info" writeTo="logfile" /> </rules>
如果我改变布局,使用不属于aspnet *系列的任何渲染器的组合,这样做很好(我没有测试过,但是我已经看了很多)。我得到的错误在这里:
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error message: An error occurred creaTing the configuration section handler for nlog: Exception occurred when loading configuration from C:\..[snip]..\web.config source Error: Line 16: </configSections> Line 17: Line 18: <nlog xmlns="http://www.nlog-project.org/scheR_796_11845@as/NLog.xsd" Line 19: xmlns:xsi="http://www.w3.org/2001/XMLscheR_796_11845@a-instance" throwExceptions="true"> Line 20:
我真的不知道发生了什么。我不知道该渲染器会导致配置无效。我一直在大声喧哗,没有任何地方,所以我希望有人能帮忙。
谢谢!
<nlog xmlns="http://www.nlog-project.org/scheR_796_11845@as/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLscheR_796_11845@a-instance" throwExceptions="true"> <extensions> <add assembly="NLog.Extended" /> </extensions> <variable name="logDirectory" value="C:\Logs" /> <targets> <target name="logFile" xsi:type="File" filename="${logDirectory}\app.log" layout="${aspnet-user-identity} ${messagE}" /> </targets> <rules> <logger name="*" minlevel="Debug" writeTo="logfile" /> </rules> </nlog>
以上是大佬教程为你收集整理的asp.net-mvc – NLog在所有aspnet布局渲染器上抛出配置异常全部内容,希望文章能够帮你解决asp.net-mvc – NLog在所有aspnet布局渲染器上抛出配置异常所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。