【问题标题】:Problem Upgrading NHibernate SQLite Application to .Net 4.0将 NHibernate SQLite 应用程序升级到 .Net 4.0 时出现问题
【发布时间】:2011-02-07 07:14:07
【问题描述】:

我有一个使用 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.`

对项目所做的唯一更改是将目标框架切换到 4.0。

【问题讨论】:

标签: .net nhibernate sqlite fluent-nhibernate


【解决方案1】:

您需要使用compatible with .NET 4.0 的SQLite 版本。您也可以尝试将其放入您的 app.config:

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

【讨论】:

  • 把它放到 app.config 中修复了它。
【解决方案2】:

如果接受的答案对您不起作用,请检查您是否有 64 位系统,如果有,请右键单击您的项目 -> 属性 -> 构建 -> 将平台目标设置为 x86 并重新构建。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-12-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-15
    • 1970-01-01
    相关资源
    最近更新 更多