简体   繁体   English

仅在Windows XP上出现Log4net GAC问题

[英]Log4net GAC problem only on Windows XP

we are currently implementing logging functionality with Log4net into our ASP.NET web-services. 我们目前正在使用Log4net将日志功能实现到我们的ASP.NET Web服务中。 Therefore we have installed Log4net into the GAC (global assembly cache) on every machine. 因此,我们已在每台计算机上将Log4net安装到GAC(全局程序集缓存)中。 On our Windows 2003 servers this works just fine. 在我们的Windows 2003服务器上,这很好用。

Funny thing is, when developing on our local clients, logging with Log4net doesn't work unless we copy the log4net.dll into the Bin folder of the ASP.NET website even though it is already installed in the GAC. 有趣的是,在我们的本地客户端上进行开发时,使用Log4net进行日志记录不起作用,除非我们将log4net.dll复制到ASP.NET网站的Bin文件夹中,即使它已经安装在GAC中。 This behaviour is for my colleague's machine and me and we just can't find the reason why. 这种行为是我的同事的机器和我,我们只是找不到原因。 The application is identically like on the server and we installed Log4net the same way into the GAC but it behaves differently. 该应用程序与服务器上的应用程序完全相同,我们以相同的方式将Log4net安装到GAC中,但行为方式不同。

We've tested it with the VS2008 integrated web-server as well as with IIS (WinXP). 我们已经使用VS2008集成的Web服务器以及IIS(WinXP)对其进行了测试。

Any ideas, suggestions? 有什么想法,建议吗?

Thanks in advance 提前致谢

When the assembly is in the GAC you need to make sure that you specify the fully qualified name in your config file. 当程序集在GAC中时,您需要确保在配置文件中指定完全限定名称。 For example instead of: 例如,而不是:

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />

you need to have: 你需要:

<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net, Version=X.X.X.X, Culture=neutral, PublicKeyToken=xxxxxxxxx" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM