C # instructions on using adaptive Any CPU program SQLite

This switched: http://luyutao.com/2016/09/14/csharp-sqlite-any-cpu.html

Effective pro-test, thanks to the original author!

In C # if you want the program 32-bit and 64-bit adaptive systems, only need to project the "target platform" is set to "Any CPU" on the line, but if a program uses SQLite assembly, the need for the additional components some simple settings:

A download System.Data.SQLite component:
(from the official website http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki ) corresponding to download the version of .NET System.Data. SQLite binary packages, due to the adaptive 32-bit and 64-bit systems, we need to download 32 and 64 respectively connected to the non-static binary packages:

Second, the reference System.Data.SQLite.dll:
reference to the component "System.Data.SQLite.dll" in a C # program, than to download these two binary packages, we will find that in addition to SQLite.Interop components, other documents the same, so we are free to choose 32-bit or 64-bit System.Data.SQLite.dll file:

Third, the reference SQLite.Interop.dll:
New x86 and x64 two subfolders in the program generate directory, copy the downloaded SQLite.Interop.dll respectively correspond to the x86 platform and the x64 folder by System.Data.SQLite .dll automatically call based on the type of system. In order to facilitate the management, we can create a project in two folders, and set the properties SQLite.Interop.dll file is "copy if newer" generation operation is "no", so that the program automatically generated when copy SQLite.Interop.dll file:

Fourth, the compiler generated programs:
a program compiled after completing the above steps, SQLite program components can be used in 32-bit and 64-bit adaptive systems a.

Published 117 original articles · won praise 4 · views 80000 +

Guess you like

Origin blog.csdn.net/qq_36266449/article/details/104949559