与VS2012 SQLite和.NET 4.5 - 任何CPU构建 [英] SQLite with VS2012 and .NET 4.5 -- ANY CPU Build

查看:152
本文介绍了与VS2012 SQLite和.NET 4.5 - 任何CPU构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试过翻翻答案相关的问题,但没有发现任何东西,是不是几年的历史(不确定他们是否仍然去到接听),或完全回答我的问题。

I've tried looking through the answers for related questions, but haven't found anything that isn't a few years old (unsure if they are still the go-to answer) or that answers my question fully.

要求:

  • I'm developing a C# application that is to run on BOTH 32-bit and 64-bit computers. My client does NOT want to create two different releases based on x86 vs x64.
  • We're using SQLite, VS2012, and .NET 4.5. Here are the available DLLs for SQLite: http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

不幸的是,这些DLL被分成32 。比特或64位版本

Unfortunately, the DLLs are split into 32-bit or 64-bit releases.

问题:


  • 是否有可能包括DLL和开关在他们的基础上的处理器?我该怎么做呢?

  • 我读过一些关于GAC中,并从我读过,这是一个本地的解决方案。要实现此为我的应用程序,我不得不安装的DLL到GAC,每次安装,是否正确?

  • 我可以强制程序在32位模式下在64运行位环境,从而失去了64位的优势,但能够在两种环境下运行我的程序没有问题?

部分我不能确定可能的答案会为我的情况下工作:


  • 查看最近的答案(第三个向下):< A HREF =htt​​p://stackoverflow.com/questions/6503634/64-bit-sqlite-dll-and-any-cpu> 64位SQLite.dll和任何CPU

  • 从2012年的回答似乎很有希望,但这个答案的第一个评论破灭了我的希望:的在一个32bit和64bit C#世界

  • See most recent answer (third one down): 64-bit SQLite.dll and Any CPU
  • The answer from 2012 seemed promising, but the first comment on that answer dashed my hopes: Options for using System.Data.SQLite in a 32bit and 64bit C# world

推荐答案

是的。只需使用的NuGet包 System.Data.SQLite 。它将安装x86和x64子目录到你的项目,当编译成你的bin。 32位和64位的DLL互操作复制到这些,并根据您的CPU上运行时适当选择。所以,你用选择任何CPU,可以运行您的32位或64位Windows应用程序。

Yes. Just use the NuGet package System.Data.SQLite. It will install an x86 and x64 subdirectory into your project and, when compiled, into your bin. The 32 bit and 64 bit interop DLLs are copied into those and selected appropriately at runtime based on your CPU. So you build with "Any CPU" selected and can run your application on 32 or 64 bit Windows.

这篇关于与VS2012 SQLite和.NET 4.5 - 任何CPU构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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