Log4Net 和 .NET 4.0
一段时间没有发布任何 log4net 版本。这对于 3.5 来说并没有出现任何问题,但是对于 .NET 4 呢?有人听说过有关支持版本 4 框架的版本的传言吗?
There have not been any log4net release for some time. This has not presented any problems with 3.5, but what about .NET 4? Has anyone heard any rumblings about a release to support the version 4 framework when it comes out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
“使用 .NET 4. 项目,您仍然可以使用 log4net。您必须将项目上的目标平台更改为“.NET Framework 4”...”
是正确的。但是您需要将该行
放在配置文件的底部(在 log4net 设置之后):
Tested with log4net 1.2.10.0
您需要放置以下行:
[程序集:log4net.Config.XmlConfigurator(Watch = false)]
在 Assemblyinfo.cs 中(我忘记了)
"With .NET 4. Projects you can still use log4net. You will have to change the target platform to ".NET Framework 4" on the project..."
Is correct. But you need to put the line
to the bottom of the configuration file (after the log4net setup):
Tested with log4net 1.2.10.0
You need to put the line:
[assembly: log4net.Config.XmlConfigurator(Watch = false)]
in Assemblyinfo.cs (I forgot that)
对于 .NET 4. 项目,您仍然可以使用 log4net。您必须将项目的目标平台更改为“.NET Framework 4”。
更多详情....
http://krishnabhargav。 blogspot.com/2010/02/using-net-35-clr-20-dll-inside-visual.html
With .NET 4. Projects you can still use log4net. You will have to change the target platform to ".NET Framework 4" on the project.
More details....
http://krishnabhargav.blogspot.com/2010/02/using-net-35-clr-20-dll-inside-visual.html
跟踪系统存在问题
4.0支持。
如果需要可以编译版本自己使用最新版本 - 它将编译。
There is an issue in the tracking system for
4.0 support.
If you need it, you can compile the version yourself with the latest release - it will compile.
以下是我们关于使用 C# 和 .Net 4.0 将 log4net 与 VS2010 配合使用的说明。它基本上遵循 tseonet 帖子,但只有几个简单的步骤。我们还将安全级别设置为 1,而不是注释AllowPartiallyTrustedCallers,但这两个选项似乎都有效。
希望这对某人有用:
http://www.charlestonsw.com/configuring- log4net-with-vs2010-and-net-4-0/
Here are our notes about getting log4net working with VS2010 with C# and .Net 4.0. It basically follows the tseonet post but in a few simple steps. We also set security level to 1 instead of commenting AllowPartiallyTrustedCallers, but either option appears to work.
Hope this is useful to someone:
http://www.charlestonsw.com/configuring-log4net-with-vs2010-and-net-4-0/
有一个针对 .NET 4.0 和客户端配置文件的 JIRA 条目 () 但是 < a href="https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&mode=hide&sorter/order=DESC&sorter/field=priority&resolution=-1&pid=10690& ;fixfor=12310980" rel="nofollow noreferrer">预计不会在 1.2.11 中发布。
有一个相关的(未回答的)问题,其中的评论建议您可以简单地 运行 1.2.10 源通过VS2010升级流程。
There is a JIRA entry for .NET 4.0 and Client Profiles () but it is not slated for release in 1.2.11.
There is a related (unanswered) question with a comment that suggested you can simple run the 1.2.10 source through the VS2010 upgrade process.
我在我的 asp.net Web 应用程序中使用 log4net ,没有问题。
我按照本教程工作: http://www.codeproject.com/KB/trace/Log4Net_with_ASP_NET .aspx
i work with log4net in my asp.net Web Application and no problem.
i work by this tutorial: http://www.codeproject.com/KB/trace/Log4Net_with_ASP_NET.aspx
看来当前的log4net trunk支持.NET Framework 4.0。此支持尚未随版本一起提供。
It seems that the current log4net trunk supports the .NET Framework 4.0. This support has just not yet been shipped with a release.