Log4net GAC problem only in Windows XP

We are currently implementing logging features using Log4net in our ASP.NET web services. Therefore, we installed Log4net in the GAC (global assembly cache) on each computer. On our Windows 2003 servers, this works fine.

It's funny that when developing our local clients, Log4net registration does not work unless we copy the log4net.dll file to the Bin folder on the ASP.NET website, even if it is already installed in the GAC. This behavior is for my colleague and me, and we simply cannot find the reason. The application is identical on the server, and we installed Log4net in the same way in the GAC, but it behaves differently.

We tested it using the integrated web server VS2008, as well as with IIS (WinXP).

Any ideas, suggestions?

Thanks in advance

+3
source share
1 answer

When the assembly is in the GAC, you need to make sure that you specify the full name in your configuration file. For example, instead of:

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

you need:

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

Source: https://habr.com/ru/post/1740348/


All Articles