简体   繁体   English

SQLite 的 dotConnect 包不适用于 VS2013 中的 64 位 C# 项目?

[英]the package of dotConnect for SQLite does not work for 64 bits C# project in VS2013?

This is a follow-up question from这是来自的后续问题

  http://stackoverflow.com/questions/36166266/sqlite3-dll-cannot-be-used-in-c-sharp-application-in-vs2013-on-win-7/36169278#36169278

I installed dotConnect.Express.for.SQLite from我安装了 dotConnect.Express.for.SQLite 从

https://www.nuget.org/packages/dotConnect.Express.for.SQLite/ https://www.nuget.org/packages/dotConnect.Express.for.SQLite/

Now, for the C# project of 32 bits, it worked.现在,对于 32 位的 C# 项目,它起作用了。 But, for x64, I got error:但是,对于 x64,我收到错误:

 An unhandled exception of type 'System.IO.FileLoadException' occurred in XMR.UserModel.dll

  Additional information: Could not load file or assembly 'Devart.Data.SQLite, Version=5.2.457.0, Culture=neutral, PublicKeyToken=09af7300eec23701' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

it seems that .net needs a x64 version but the installed "dotConnect" is 32 bits ?似乎 .net 需要 x64 版本,但安装的“dotConnect”是 32 位的?

Any suggestions ?有什么建议 ?

dotConnect for SQLite assemblies are built with the /platform:anycpu option.用于 SQLite 程序集的 dotConnect 是使用 /platform:anycpu 选项构建的。 So, you can use provider's assemblies on any platform (x86 or x64).因此,您可以在任何平台(x86 或 x64)上使用提供程序的程序集。 For more information, refer to http://msdn.microsoft.com/en-us/library/zekwfyz4.aspx .有关详细信息,请参阅http://msdn.microsoft.com/en-us/library/zekwfyz4.aspx

However, you need to ensure that you are using the compatible version of the engine library sqlite3.dll.但是,您需要确保您使用的是兼容版本的引擎库 sqlite3.dll。 The engine library version of the proper capacity is deployed during installation of desktop dotConnect for SQLite.在安装用于 SQLite 的桌面 dotConnect 期间部署了适当容量的引擎库版本。 To get both versions (x86 and x64) of sqlite3.dll, please install desktop dotConnect for SQLite Express from https://www.devart.com/dotconnect/sqlite/download.html .要获得 sqlite3.dll 的两个版本(x86 和 x64),请从https://www.devart.com/dotconnect/sqlite/download.html为 SQLite Express 安装桌面 dotConnect。 By default, installation puts these files here:默认情况下,安装会将这些文件放在这里:

  • C:\\Program Files (x86)\\Devart\\dotConnect\\SQLite\\sqlite3.dll C:\\Program Files (x86)\\Devart\\dotConnect\\SQLite\\sqlite3.dll

  • C:\\Program Files (x86)\\Devart\\dotConnect\\SQLite\\x64\\sqlite3.dll C:\\Program Files (x86)\\Devart\\dotConnect\\SQLite\\x64\\sqlite3.dll

When deploying, create a folder named "x86" (without quotes) or "x64" (without quotes) and place it in the folder with assembly of your application.部署时,创建一个名为“x86”(不带引号)或“x64”(不带引号)的文件夹,并将其放置在包含应用程序程序集的文件夹中。 It is the first place where dotConnect for SQLite will look for sqlite3.dll.它是 dotConnect for SQLite 查找 sqlite3.dll 的第一个位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM