3
votes

I am trying out Fluent NHibernate 2.12 with System.Data.SQLite (ver 1.0.74.0 with .NET4 x64).
When trying to create my session factory I get the following error (innermost exception):

The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found. Ensure that the assembly System.Data.SQLite is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use element in the application configuration file to specify the full name of the assembly.

Tried what was already suggested my app.config looks like this:

<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
  <runtime>    
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" >
      <probing privatePath="Lib\NHibernate;Lib\Castle;Lib\SQLite"></probing>
      <qualifyAssembly
        partialName="System.Data.SQLite"
        fullName="System.Data.SQLite, Version=1.0.74.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
    </assemblyBinding>
  </runtime>
</configuration>

and My private probing path contains the correct files (already checked that)
anyone has a clue?

1
Are you referencing the SQLLite DLL in your project?csano
can you look at the .net-assembly-resolve-log with Fuslogvw.exe? there you can see where he searches for sqllite and if there are any problems loading itFiro

1 Answers

0
votes

I just recently set up fluent nhibernate with SQLite for unit tests so here are some tips I can give you. If you are debugging with Visual Studio 2010 you will need to use SQLite 32 bit sadly. There is a known bug that should be included with the next release of visual studio when you try to include 64 bit assemblies. Other than that might I suggest you make sure you have included the following entries in your web config.

<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <supportedRuntime version="v4.0"/>
    </startup>
</configuration>

PS found a reference to the bug http://connect.microsoft.com/VisualStudio/feedback/details/556670/could-not-load-file-or-assembly-error-when-referencing-a-64-bit-assembly