开发者

Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.1.0.4000

开发者 https://www.devze.com 2023-04-06 02:21 出处:网络
I have a tests project that I am trying to test my nhibernate layer with using sql lite in-memory database.

I have a tests project that I am trying to test my nhibernate layer with using sql lite in-memory database.

I'm getting the error:

Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.1.0.4000,

private void CreateSessionFactory()
{
            _sessionFactory = Fluently
            .Configure()
            .Database(_dbType)
            .Mappings(m => m.FluentMappings
                .AddFromAssemblyOf<UserMap>())
            .ExposeConfiguration(cfg => _configuration = cfg)
            .BuildSessionFactory();
}

I'm using fluentnhibernate, and nunit also.

What could开发者_如何学C the issue be?

Update

I downloaded the x64 (i'm on windows 7 64-bit) from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki and now I'm getting this error:

 Unable to load DLL 'SQLite.Interop.DLL': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

If I try and add the Interop.dll in vs.net 2010, it doesn't let me saying it could not be added, make sure it is valid etc.


Latest version of SQLite for .NET is distributed as 2 dlls.

  • System.Data.SQLite.dll
  • SQLite.Interop.dll

Both dlls need to be present in the same folder as your EXE. Interop dll is platform specific so you have to manually (or Post-build) copy x86 or x64 version.

Another thing to keep in mind is that SQLite.Interop.dll itslef depends on MSVCR100.DLL (part of Visual C++ 2010 SP1 Redistributable Package). You can get it here:

  • 64 bit version
  • 32 bit version
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号