English 中文(简体)
log4net with .NET 4.0
原标题:

I ve thrown together some code to tinker with the new .Net 4.0/VS 2010 pieces, but I can t seem to find a build of my logging framework of choice (log4net) for 4.0, and I m getting reference errors with the 2.0 version. Is there a 4.0 version available somewhere? I m not asking for new features, just a version that s already been rebuilt against the new assemblies. Anyone know where I can find a build of 1.2.10 built for the 4.0 framework?

最佳回答

log4net has a known issue of referencing a System.Web component which is not part of the .NET Framework 4 Client Profile and the VS2010 by default sets project target to be the lightweighted Client Profile. The solution is to change the target to .NET Framework 4:

Right click project -> properties -> Application. Change:

 .NET Framework 4 Client Profile

to be:

 .NET Framework 4

... and that should work, i.e. you can use log4net again...

问题回答

暂无回答




相关问题
Log4Net and extra fields

Is it possible to insert extra fields into the database and use them in log4net? I have a UserId I would like to have in an extra field in the log-table. I have added the field in the log4net.config:...

log4net with .NET 4.0

I ve thrown together some code to tinker with the new .Net 4.0/VS 2010 pieces, but I can t seem to find a build of my logging framework of choice (log4net) for 4.0, and I m getting reference errors ...

Best logging approach for composite app?

I am creating a Composite WPF (Prism) app with several different projects (Shell, modules, and so on). I am getting ready to implement logging, using Log4Net. It seems there are two ways to set up the ...

log4net log files disappear when service restarted

We are using log4net to create our logfiles from Windows services, and we are using the RollingFileAppender rolling based on date. The version of log4net we are using is 1.2.9. Now for the issue. ...

How do I use a date pattern in a header/footer?

Here s my appender configuration from my app.config. This just prints out the literal string instead of translating it to the date (i.e., it literally prints "[START: %date{MM/dd/yy HH:mm} ]"). <...

热门标签