开发者

Log4net GAC problem only on Windows XP

we are currently implementing logging functionality with Log4net into our ASP.NET web-services. Therefore we have installed Log4net into the GAC (global assembly cache) on every machine. On our Windows 2003 servers this works just fine.

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. 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.

We've tested it with the VS2008 integrated web-server as well as with 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. 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" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜