简体   繁体   中英

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

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

Now, for the C# project of 32 bits, it worked. But, for x64, I got error:

 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 ?

Any suggestions ?

dotConnect for SQLite assemblies are built with the /platform:anycpu option. So, you can use provider's assemblies on any platform (x86 or x64). For more information, refer to 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. The engine library version of the proper capacity is deployed during installation of desktop dotConnect for SQLite. 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 . By default, installation puts these files here:

  • C:\\Program Files (x86)\\Devart\\dotConnect\\SQLite\\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. It is the first place where dotConnect for SQLite will look for sqlite3.dll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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