无法从NHibernate.Driver.SQLite20Driver,NHibernate版本= 3.1.0.4000创建驱动程序 [英] Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=3.1.0.4000

查看:141
本文介绍了无法从NHibernate.Driver.SQLite20Driver,NHibernate版本= 3.1.0.4000创建驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试项目,我试图用sql lite内存数据库来测试我的nhibernate层。 p>

无法从NHibernate.Driver.SQLite20Driver,NHibernate,Version = 3.1.0.4000,

创建驱动程序

  private void CreateSessionFactory()
{
_sessionFactory =可以流利
.Configure()
.Database(_dbType)
.Mappings(m => m.FluentMappings
.AddFromAssemblyOf< UserMap>())
.ExposeConfiguration(cfg => _configuration = cfg)
.BuildSessionFactory



$ b我使用的是fluentnhibernate和nunit。
$ b

问题可能是什么?
$ b 更新

我从 http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki 现在我收到这个错误:

 无法加载DLL'SQLite.Interop.DLL':无法找到指定的模块。 (从HRESULT异常:0x8007007E)

如果我尝试在vs.net 2010中添加Interop.dll ,它不让我说它不能被添加,确保它是有效的等。

解决方案

最新版本的< SQLite for .NET 分发为2个dll。


  • System.Data.SQLite.dll

  • SQLite.Interop.dll



这两个dll都必须与EXE位于同一个文件夹中。 Interop dll是特定于平台的,因此您必须手动(或后制)复制x86或x64版本。
$ b 另外要记住的是 SQLite.Interop.dll itslef依赖于 MSVCR100.DLL 的Visual C ++ 2010 SP1可再发行组件包)。你可以在这里找到它:




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 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:

这篇关于无法从NHibernate.Driver.SQLite20Driver,NHibernate版本= 3.1.0.4000创建驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆