将 NHibernate SQLite 应用程序升级到 .Net 4.0 时出现问题 [英] Problem Upgrading NHibernate SQLite Application to .Net 4.0

查看:28
本文介绍了将 NHibernate SQLite 应用程序升级到 .Net 4.0 时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

`无法找到程序集 System.Data.SQLite 中的 IDbCommand 和 IDbConnection 实现.`

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

解决方案

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

<预><代码><配置><启动 useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime version="v4.0"/></启动></配置>

I have a WPF Application using Fluent NHibernate 1.0 RTM and System.Data.SQLite 1.0.65 that works fine in .Net 3.5. When I try to upgrade it to .Net 4.0 everything compiles but I get a runtime error where the innermost exception is this:

`The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found.`

The only change made to the project was switching the Target Framework to 4.0.

解决方案

You need to use a version of SQLite that is compatible with .NET 4.0. You might also try putting this in your app.config:

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

这篇关于将 NHibernate SQLite 应用程序升级到 .Net 4.0 时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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