Everything is fluent

Since fluent is just everywhere, I thought that I would have to go the fluent NHibernate road as well. Turned out to be quite wacky.

First of – I just wrapped up all my referenced assemblies: Castle Windsor 2.0 (which is actually internally labeled as 1.1) as well as all the other stuff and NHibernate 2.1 GA. Then adding the new kind in town: Fluent NHibernate.

And this is where the trouble begins … Fluent NHibernate is build against 2.1.0.4000 of NHibernate (= 2.1 GA). This is good, since I just downloaded this exact version. But wait – what’s my most favorite NHIntegrationFacility doing there – it’s actually linked against 2.1.0.1003. So this screws me off.

OK – don’t panic! Fortunatly .Net has the ability to redirect assembly bindings. Just a little bit of tweaking in the app.config does the trick:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="2.1.0.1003" newVersion="2.1.0.4000"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Leave a Comment.