Could not create the driver from NHibernate.Driver.SQLite20Driver

使用NHibernate连接Sqlite语句,版本为.net3.5。 升级.net 4.0出现异常,提示”Could not create the driver from NHibernate.Driver.SQLite20Driver“。

方法1:去网上找一个.net 4.0 的兼容版本。

方法2:在app.config或者web.config中加上下面的配置,即可正常运行:

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


  <startup  useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
 

 

posted @ 2014-12-30 17:23  vonly  阅读(1407)  评论(0编辑  收藏  举报