程序停止工作,问题事件名称:CLR20r3

Iva*_*vic 9 c# sqlite visual-studio-2010

我从发布文件夹开始我的程序.在我的Windows 7 64位机器上它正在工作.

在虚拟机Windows 7 32位中,它正在运行.

在Windows 7 64位的第三台机器上它无法正常工作.

在我安装了.NET Framework 4的每台机器上,我的项目使用.NET Framework 3.5,因为我使用SQLite数据库,而SQLite dll因为我理解需要将项目作为.NET Framework 3.5.

我正在使用Visual Studio 2010 Express版,SQLite数据库.

这是来自第三台计算机的错误:

Description:
Stopped working

Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01:   geotest.exe
Problem Signature 02:   1.0.0.0
Problem Signature 03:   4e58f462
Problem Signature 04:   GeoTest
Problem Signature 05:   1.0.0.0
Problem Signature 06:   4e58f462
Problem Signature 07:   f
Problem Signature 08:   12
Problem Signature 09:   System.BadImageFormatException
OS Version: 6.1.7600.2.0.0.256.1
Locale ID:  1033
Run Code Online (Sandbox Code Playgroud)

hyd*_*dic 8

从3.0版开始,公共语言运行时使用不同的方法来加载混合模式程序集(其中一个包含托管代码本机代码),如SQLite.由于SQLite是针对.NET Framework 2.0构建的,因此我们必须明确告诉CLR使用旧的2.0方式加载混合模式程序集:

在项目中添加(或更新)app.config:

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

其他问题也揭示了更多有关此问题的信息:SQLite特定/通用解释


Iva*_*vic 1

在发布文件夹中没有 System.Data.SQLite.DLL,这是问题所在。现在,当我复制它时,一切正常。