无法创建NHibernate.Driver.SQLite20Driver司机 [英] Could not create the driver from NHibernate.Driver.SQLite20Driver

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

问题描述

下面是引发异常

   public Configuration GetConfiguration()
    {
        var persister = SQLiteConfiguration
            .Standard
            .UsingFile("Test.db")
            .ShowSql();


        var configuration = Fluently
            .Configure()
            .Database(persister)
            .Mappings(map => map.FluentMappings.AddFromAssemblyOf<WordMap>())
            .BuildConfiguration();

        new SchemaExport(configuration).Execute(true, true, false);

        return configuration;

    }



完整异常文本:

The full exception text:

失败:NHibernate.HibernateException:无法创建NHibernate.Driver.SQLite20Driver,NHibernate的,版本= 2.1.2.4000,
文化司机
=中性公钥= aa95f207798dfdb4

Failure: NHibernate.HibernateException : Could not create the driver from NHibernate.Driver.SQLite20Driver, NHibernate, Version=2.1.2.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4.

----> System.Reflection.TargetInvocationException:异常已被调用的目标引发异常

----> System.Reflection.TargetInvocationException : Exception has been thrown by the target of an invocation.

----> NHibernate.HibernateException:在装配System.Data.SQLite的IDbCommand和实施的IDbConnection可以
不会被发现。确保大会System.Data.SQLite位于
在应用程序目录或全局程序集缓存。如果
程序集是在GAC中,使用元素
应用程序配置文件中指定
组装的全名。

----> NHibernate.HibernateException : 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.

NHibernate的版本号为2.1.2.4000结果$ b System.Data.SQLite的$ b版本是1.0.66.0结果
目标框架是3.5(x86)的
为System.Data.SQLite
本地副本开启。

Version of NHibernate is 2.1.2.4000
Version of System.Data.SQLite is 1.0.66.0
Target Framework is 3.5 (x86)
Local copy for System.Data.SQLite is ON.

怎么可能是错的?

推荐答案

我被加入useLegacyV2RuntimeActivationPolicy =摆脱这一问题的真到的app.config。请参见问题升级NHibernate的SQLite的应用.NET 4.0

I got rid of this issue by adding useLegacyV2RuntimeActivationPolicy="true" to app.config. See Problem Upgrading NHibernate SQLite Application to .Net 4.0

这篇关于无法创建NHibernate.Driver.SQLite20Driver司机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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