CS0433 Asp.net 网站错误?

发布于 2024-08-23 01:38:16 字数 465 浏览 1 评论 0原文

我在 Asp.Net 2.0 网站中收到 log4Net 的以下错误。

编译器错误消息:CS0433:类型 'log4net.Config.XmlConfigurator' 存在于两者中 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\临时 ASP.NET 文件\ caps_2.25 \ bc79a253 \ fd331fcd \ assembly \ dl3 \ 6113a1ef \ 008a4b7c_09b0ca01 \ log4net.DLL' 和 'c:\ WINDOWS \ assembly \ GAC_MSIL \ log4net \ 1.2.10.0__1b44e1d426115821 \ log4net.dll'

如何使 Asp.Net 使用本地 log4Net.dll 而不是 GAC 中的 log4Net.dll?

I am getting following error for log4Net in Asp.Net 2.0 website.

Compiler Error Message: CS0433: The type
'log4net.Config.XmlConfigurator' exists in both
'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\caps_2.25\bc79a253\fd331fcd\assembly\dl3\6113a1ef\008a4b7c_09b0ca01\log4net.DLL'
and
'c:\WINDOWS\assembly\GAC_MSIL\log4net\1.2.10.0__1b44e1d426115821\log4net.dll'

How to make Asp.Net to use the local log4Net.dll instead of the one from GAC?

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

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

发布评论

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

评论(2

青瓷清茶倾城歌 2024-08-30 01:38:16

查看对 此内容的回复非常相似的问题

获奖答案摘要:

“如果它(任何 DLL)具有相同的版本
编号作为引用的 DLL,GAC
被习惯了。

如果您增加版本号,
重建网站引用
新的版本号,把新的
/bin 目录中的版本,然后
将使用该 DLL。

如果您不想更改
版本号,你已经差不多了
运气。

Check out the responses to this very similar question.

A summary of the winning answer:

"If it (any DLL) has the same version
number as the referenced DLL, the GAC
gets used.

If you increment the version number,
rebuild the website referencing the
new version number, put the new
version in the /bin directory, then
that DLL will be used.

If you do not want to change the
version number, you're pretty much out
of luck.
"

顾忌 2024-08-30 01:38:16

我肯定会删除临时文件中的那个。然后您可以决定是否要从 GAC 中删除该安装程序(可能只需再次运行安装程序并将其卸载即可)。如果您想使用本地目录,我会先将其复制并粘贴到您的 bin 目录中。

I would delete the one in the temporary files for sure. Then you can decide if you want to remove the one from the GAC probably just by running the installer again and just uninstall it. I would copy and paste it first into your bin directory if you want to use the local one.

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