views:

416

answers:

2

Hi,

I've had a system up and running that used the Fluent NHibernate pre-release v0.0.1.0 along with NHibernate 2.1.0.4000 and NHibernate.Linq 1.0.0.0.

I've just put in the new Fluent NHibernate RTM dlls and fixed my code for the breaking changes but I'm getting a couple of issues dependant on how I try to implement.

1) If I don't change the NHibernate dll to the one that is supplied with the FluentNHibernate then I get an error message complaining that Fluent NHibernate targets a different version of NHibernate even though both have the same version number.

The exception message is as follows: 'Assembly 'FluentNHibernate, Version=1.0.0.593, Culture=neutral, PublicKeyToken=8aa435e3cb308880' uses 'NHibernate, Version=2.1.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4' which has a higher version than referenced assembly 'NHibernate, Version=2.0.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4'

2) If I change the NHibernate dll to the one that is supplied with the FluentNHibernate RTM then my program breaks when trying to resolve the assemblies in the class that uses NHibernate.Linq. It also complains about found conflicts between dependant versions of the same assembly.

If NHibernate.Linq 1.0.0.0 can't be used with Fluent NHibernate then that's fine and I'll find a way around it but I'm interested if anyone has found a way for them to play nicely together and why there are apparently two divergent versions of NHibernate with the same version number.

Thanks,

A: 

You may try to use assembly binding redirection for this as described here.

Here is the sample that could work for you (haven't tried though)

elder_george
I've tried that but I think because the version numbers are the same, it was unable to re-direct. At least I got exactly the same error after adding the re-direct into the app.config.
Wysawyg
Very interesting and strange. Have you tried to set oldVersion as a version range (oldVersion="2.0.0.0-2.1.65534.65534")
elder_george
To start off with I just used the auto-generated syntax from Visual Studio 2008 so it did oldVersion="0.0.0.0-2.1.0.4000" then I tried the example syntax you suggested and then I just tried combining the two and using the range and still no joy.
Wysawyg
+1  A: 

Your version numbers aren't the same according to that exception.

... 'FluentNHibernate' uses 'NHibernate, Version=2.1.0.4000 ... which has a higher version than referenced assembly 'NHibernate, Version=2.0.1.4000 ...

2.1.0.4000 vs. 2.0.1.4000

James Gregory