【问题标题】:What SQLite Database connection additional configuration information?SQLite 数据库连接有哪些附加配置信息?
【发布时间】:2012-08-24 16:23:11
【问题描述】:

尝试连接 SQLite 数据库文件时发生该错误

混合模式程序集是针对运行时版本“v2.0.50727”构建的,并且无法在 4.0 运行时中加载而无需额外的 配置信息。

我的连接字符串是:

“数据源=KBank;版本=3;”

我正在使用 Visual Studio 2010 .Net Framework 4.0

知道什么是附加配置吗?

【问题讨论】:

    标签: c# .net database sqlite


    【解决方案1】:

    您需要设置useLegacyV2RuntimeActivationPolicy in your startup element of the app.config 文件。

    您可以制作一个 app.config 文件,并将其设置为:

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

    这会导致所有程序集使用 CLR 4,并“有效地禁用 CLR 的进程内并行功能”。在使用 .NET 4 应用程序中以 .NET 3.5 或更早版本编写的混合模式程序集(包含本机代码)时,这是必需的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-20
      • 2014-03-28
      • 1970-01-01
      • 2011-10-11
      • 1970-01-01
      • 2022-12-05
      相关资源
      最近更新 更多