您的位置:首页 > 博客中心 > 数据库 >

Could not create the driver from NHibernate.Driver.SQLite20Driver

时间:2022-03-14 04:26

使用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>
 

 

热门排行

今日推荐

热门手游