2
votes

Hi I'm trying to build a project using FluentNHibernate with a connection to a MS Access database. I build the JetDriver dll in https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.JetDriver/ using Visual Studio 2010 on Windows 7 64-bit. I made sure the project is compiled for x86 CPU and then I copied the generated dll into the other project and made a reference to it. When I'm running the project I get this exception:

"Could not load file or assembly 'NHibernate, Version=1.0.4.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"NHibernate, Version=1.0.4.0, Culture=neutral, PublicKeyToken=154fdcb44c4484fc"

In this method:

return Fluently.Configure()
    .Database(
        JetDriverConfiguration.Standard.ConnectionString(
            c => c.DatabaseFile(Settings.Default.SnelstartAdministrationName + ".mdb"))
            )
    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<OrderMap>())
    .BuildSessionFactory();

Does this mean JetDriver.dll is expecting version 1.0.4.0 of NHibernate.dll? How do I make sure it wants the NHibernate.dll which is included in my project?

How is http://www.ohloh.net/p/NHibernateContrib related to https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.JetDriver/? I can't find the driver in http://www.ohloh.net/p/NHibernateContrib code.

2
This is not a FluentNHibernate issue - but rather an NHibernate issue. FluentNHibernate just assists with mappings. If you're having issues connecting to a specific type of database (short of the session factory configuration) or with queries, then the issue is with NHibernate. That being said - look around for this problem using the NHibernate keyword instead of FluentNHibernate and you will find answers. This was mine: stackoverflow.com/questions/6834332/…Origin

2 Answers

1
votes

Before building NHibernate.JetDriver replace any NHibernate .dll files that came with the source, with files from the version you are using (3.1) and try again.

I have done this before but with version 2.x. I hope it works for 3.1 too.

0
votes

Which version of nhibernate and fluent nhibernate you are use?
I think you are use different version of fluent nhibernate to nhibernate if you use nhibernate 3.2 you must use fluent nhibernate version 1.3.0.717 and you can download from this link