views:

120

answers:

1

Hello,

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

+2  A: 

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" />
Darin Dimitrov
Great, now it works! :)Thank you for the quick reply, Darin!Now I just wonder why it was already working on our servers anyway.
mono68