仅在 Windows XP 上出现 Log4net GAC 问题

发布于 2024-08-28 03:38:54 字数 404 浏览 2 评论 0原文

我们目前正在使用 Log4net 将日志记录功能实现到我们的 ASP.NET Web 服务中。因此,我们将 Log4net 安装到每台机器上的 GAC(全局程序集缓存)中。在我们的 Windows 2003 服务器上,这工作得很好。

有趣的是,当在本地客户端上进行开发时,除非我们将 log4net.dll 复制到 ASP.NET 网站的 Bin 文件夹中,否则使用 Log4net 进行日志记录将不起作用,即使它已经安装在 GAC 中。这种行为适用于我同事的机器和我,但我们只是找不到原因。该应用程序与服务器上的应用程序完全相同,我们以相同的方式将 Log4net 安装到 GAC 中,但其行为不同。

我们已经使用 VS2008 集成 Web 服务器以及 IIS (WinXP) 对其进行了测试。

有什么想法、建议吗?

提前致谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溺孤伤于心 2024-09-04 03:38:54

当程序集位于 GAC 中时,您需要确保在配置文件中指定完全限定名称。例如,

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

您需要:

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

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" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文