x86和x64 System.Data.SQLite问题 [英] x86 and x64 System.Data.SQLite issue

查看:721
本文介绍了x86和x64 System.Data.SQLite问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现了很多关于这个问题的问题,但没有找到任何答案。我有一个很奇怪的问题。当我添加了 System.Data.SQLite 32位的引用我的项目,它只能在x86平台上,这应该是罚款由我为我的应用程序将在32位只运行视窗。但是,当我尝试运行32位的Windows应用程序,它抛出的异常无法加载文件或程序集System.Data.SQLite。于是我下载了 System.Data.SQLite DLL 的64位版本。然后我可以开始调试与CPU的任何目标平台,但不能在我的32位XP中也有同样的错误无法加载文件或程序运行应用程序System.Data.SQLite

我要有点疯狂。我不知道这是任何意义的,我看不出有什么,但目标框架,我的应用程序是.NET 4.0中,我试图 System.Data.SQLite (.NET 2.0,.NET 3.5,.NET 4.0),32位和64位版本,没有什么帮助。下面是我的配置文件是这样的:

 < System.Data这>
    < D​​bProviderFactories>
      <清除不变=System.Data.SQLite/>
      <添加名称=SQLite的数据提供程序不变=System.Data.SQLite描述= TYPE =System.Data.SQLite.SQLiteFactory,System.Data.SQLite/&GT净Framework数据提供的SQLite。
    < / DbProviderFactories>
  < /system.data>

  <的ConnectionStrings>
    <添加名称=VetStationConnection的connectionString =数据源= VeterinaryStation.s3db的providerName =System.Data.SQLite.SQLiteFactory/>
  < /的ConnectionStrings>
 

解决方案

我找到了解决办法。实际我发现,我犯的错误:)我下载的都没有静态链接的二进制文件,它需要Visual C ++运行。因此,对于这个解决方案是安装Visual C ++运行或下载system.data.sqlite静态链接的二进制文件:D

I found a lot of questions about this problem but did not find any answers. I have a rather strange problem. When I add a 32bit reference for System.Data.SQLite to my project it only works on x86 platform, and that should be fine by me as my app will run only on 32bit Windows. But when I try to run the app on 32bit Windows it throws the exception Could not load file or assembly 'System.Data.SQLite'. Then I downloaded 64bit version of System.Data.SQLite dll. Then I could start debug with ANY CPU target platform, but couldn't run the app on my 32bit XP that had the same error Could not load file or assembly 'System.Data.SQLite'.

I'm going a bit crazy. I don't know it is of any relevance, I don't see any, but target framework for my app is .NET 4.0 and I tried every combination of System.Data.SQLite (.NET 2.0, .NET 3.5, .NET 4.0) 32bit and 64bit version, nothing helps. Here is how my config file looks like:

<system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
    </DbProviderFactories>
  </system.data>

  <connectionStrings>
    <add name="VetStationConnection" connectionString="Data Source=VeterinaryStation.s3db" providerName="System.Data.SQLite.SQLiteFactory"/>
  </connectionStrings>

解决方案

I found solution. Actual I found where I made mistake :) i downloaded binaries that are no statically linked and it required visual c++ runtime. So solution for this is to install visual c++ runtime or download system.data.sqlite statically linked binaries :D

这篇关于x86和x64 System.Data.SQLite问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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