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?
-
I think I remember seeing in-proc side-by-side for 2.0/4.0-compat, but that doesn't appear to allow my 4.0 code to reference the 2.0 log4net library.– Jonathan RuppNov 19, 2009 at 23:13
-
Have you tried taking a log4net source project and running it through VS2010's upgrade process?– RCIXNov 19, 2009 at 23:22
-
I have pulled the source for 1.2.10 from the SVN server and run it through the upgrade process. It looks like so long as I define the _NET_2_0 symbol and add attribute to get the Level1 security-enforcement rules, things work. Obviously, there's more work involved for the complete 4.0 update, so I'm hoping someone has already started on that work.– Jonathan RuppNov 20, 2009 at 1:31
1 Answer
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...
-
I should say the latest releases already added support for Client profile, so no need to target the full one. Oct 18, 2011 at 19:53
-
4Downloaded today latest release, it doesn't support ClientProfile with .NET 4.0– DzmitryDec 17, 2011 at 14:23
-
6Just downloaded latest binaries (1.2.11) and it contains a version compatible with 4.0 Client Profile in \bin\net-cp\4.0\release. Just tested it and works like a charm !– SvenGApr 20, 2012 at 9:06