问题将NHibernate SQLite应用程序升级到.Net 4.0

Xav*_*vin 4 .net sqlite nhibernate fluent-nhibernate

我有一个使用Fluent NHibernate 1.0 RTM和System.Data.SQLite 1.0.65的WPF应用程序在.Net 3.5中运行良好.当我尝试将其升级到.Net 4.0时,所有内容都会编译,但我得到一个运行时错误,其中最内层的异常是:

`The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found.`
Run Code Online (Sandbox Code Playgroud)

对项目进行的唯一更改是将Target Framework切换到4.0.

Dar*_*rov 14

您需要使用与.NET 4.0兼容的SQLite版本.您也可以尝试将它放在app.config中:

<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
</configuration>
Run Code Online (Sandbox Code Playgroud)