log4net, Version=1.2.11.0

Oct 10, 2012 at 6:40 PM

Hi.

Is NOF specifically tied to log4net, Version=1.2.11.0?

I am using NServiceBus in the same project, and it requires log4net 1.2.10.0. I have removed 1.2.11.0 and specifically referenced 1.2.10.0, but it now keeps complaining that it cannot load 1.2.11.0.

Coordinator
Oct 10, 2012 at 7:39 PM

The short answer is yes.  I refer you to this discussion a year ago:  http://nakedobjects.codeplex.com/discussions/284569 

Log4Net has proven to be a bit of a pain in the neck for a lot of framework developers (including Microsoft even!).  When we upgraded to 1.2.11, we 'fixed' the version so that we wouldn't  be caught out if the authors of Log4Net do the same thing again.  

My guess is that NServiceBus may have done the same thing, but chose to stick with 1.2.10  -  making them incompatible.  Not sure what I can recommend to resolve this one

Oct 11, 2012 at 5:05 AM
Edited Oct 11, 2012 at 6:19 AM

I know NSB is stripping out all hard dependencies to log4net for their next major release, but it's still in there now.

Below is the advice I got from NSB forum: http://tech.groups.yahoo.com/group/nservicebus/message/16349

Hi Jacques,

Yes, NSB uses log4net 1.2.10.
Try to use a binding redirect and see if that works.
You need to add a binding redirect to both config files, the host + your endpoint.
Hope this helps
John

I'll try this and report back.

Oct 11, 2012 at 6:22 AM

 

No luck. I assume NOF specifically requires the version of log4net 1.2.11 that has been signed with the new public key?

I tried a version signed with the old public key, so that I could redirect the binding, but no such luck.

You can follow the link I posted if you are interested in more info.

Coordinator
Oct 11, 2012 at 6:52 AM

"I assume NOF specifically requires the version of log4net 1.2.11 that has been signed with the new public key?"

Yes.  That was the problem:  the log4net guys changed the public key (for no good reason  -  other packaged framework providers don't do this so far as I know).  We probably could have stuck with 1.2.10  (we don't need any of the new features)  -  but then we would only face the problem in reverse if you wanted to reference another framework that had gone with the new key!

We perhaps need to seriously consider other options, such as moving to a different logging framework -  but that's not something we can do in a hurry.

Editor
Oct 11, 2012 at 6:54 AM
maybe the short-term fix is to provide two distros ... one against 1.2.10 and the current against 1.2.11?


On 11 October 2012 07:52, richardpawson <notifications@codeplex.com> wrote:

From: richardpawson

"I assume NOF specifically requires the version of log4net 1.2.11 that has been signed with the new public key?"

Yes. That was the problem: the log4net guys changed the public key (for no good reason - other packaged framework providers don't do this so far as I know). We probably could have stuck with 1.2.10 (we don't need any of the new features) - but then we would only face the problem in reverse if you wanted to reference another framework that had gone with the new key!

We perhaps need to seriously consider other options, such as moving to a different logging framework - but that's not something we can do in a hurry.

Read the full discussion online.

To add a post to this discussion, reply to this email (nakedobjects@discussions.codeplex.com)

To start a new discussion for this project, email nakedobjects@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Oct 11, 2012 at 7:48 AM

"maybe the short-term fix is to provide two distros ... one against 1.2.10 and the current against 1.2.11?"

This all sounds very painful! (Sorry, feels very painful)

This might result in us having to find a solution other than NSB. Very frustrating!

Maybe they should have renamed the new version also, to "pain4net".

Coordinator
Oct 11, 2012 at 8:26 AM
Edited Oct 11, 2012 at 8:27 AM

The long term fix is for us to decouple Naked Objects from log4Net, by defining our own logging wrapper. FYI Stef advises me that ha had already done this within the Restful Objects code - because we were forced to.  (FYI, Dan, this was because of the need to create two versions of the 'surface': one for NOF2 and one for NOF4, which use different versions of log4net).  And we can then easily provide two implementations of this logging wrapper, for the two 'keyed' versions of log4net.)  Changing between these will be as simple as editing the packages.config file in your solution  -  NuGet will look after the rest.  (This would also make it easier for a user to switch to a different logging framework).

I'll raise a ticket for that shortly  -   and will prioritise it for the next release, but we don't have a timetable for that yet.  The earliest will probably be a month from now, the latest by the year-end  -  please don't push me for a date as there isn't one. (N.B. This is not a hard change, but it is not trivial either).

In the short-term, Jacques, the fix is for you to re-compile the framework using the version of log4net that you want.  This is not hard to do: it just involves configuration, not any code change.