log4net的不记录和投掷的错误 [英] log4net not logging and throwing error

查看:390
本文介绍了log4net的不记录和投掷的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用log4net的一个文本文件中写的时候没有在我的web服务的任何异常,这是工作,但今天开始抛出错误。


  System.Web.Services.Protocols.SoapException:服务器无法


  
  

处理请求。 ---> System.TypeInitializationException:类型
  初始化程序..引发了异常。
  ---> System.IO.FileLoadException:无法加载文件或程序
  'log4net的,版本= 1.2.9.0,文化=中立,
  公钥= b32731d11ce58905'或它的一个依赖。该
  位于集清单定义不匹配的程序集
  参考。 (异常来自HRESULT:0x80131040)
      文件名:'log4net的,版本= 1.2.9.0,文化=中立,
  公钥= b32731d11ce58905


 警告:程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,注册表值[HKLM \\软件\\微软\\融合!EnableLog](DWORD)设置为1。
注意:有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值[HKLM \\软件\\微软\\融合!EnableLog。

如果您对这个堆栈信息任何输入,请。分享。


解决方案

你改变code,还是这只是开始发生?

我见过当目标处理器架构是不匹配出现此错误。你有没有改变任何机会?

如果不是这种情况,并且安装了Windows SDK,可以使用融合日志查看器查看程序集绑定日志。该实用程序应安装在你的机器上。

I have been using log4Net to write in a text file when there is any exception in my web service, this was working but today it started to throw error.

System.Web.Services.Protocols.SoapException: Server was unable to

process request. ---> System.TypeInitializationException: The type initializer for.. threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905'

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

If you have any inputs on this stack info, pls. share it.

解决方案

Did you change the code, or did this just start happening?

I've seen this error occur when the target processor architecture was mismatched. Did you change that by any chance?

If this isn't the case, and you have Windows SDK installed, you can use the Fusion Log Viewer to view assembly binding logs. The utility should be installed on your machine.

这篇关于log4net的不记录和投掷的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆