SQLite Forum

how to manage VS projects SQLite DLLS
Login

how to manage VS projects SQLite DLLS

(1) By eKundl on 2020-12-12 01:29:14 [source]

i probably should have asked this when i started using SQLite... but i didn't, so...

i've got about a dozen VisualStudio solutions now using SQLite. i'm also using Dapper.

everytime i start a new solution, i use NuGet in VS to add the System.Data.SQLite.Core package... so now i have a number of projects that are using different versions of SQLite.

i'm thinking i should control this better.. like have a folder with SQLite Dll in it and just add this DLL in VS references for the project? so that all projects use the same version of SQLite when i 'rebuild' the solution?

does adding the NuGet package make any changes to the VS project other than include the one System.Data.SQLite.dll? there are two folders in the Release folder, x64 and x86 with SQLite.Interop.dll files in them.. so i assume these are created due to the NuGet SQLite package?

should i just not worry about the different versions? or is there a way to change my procedure so i can keep SQLite versions consistent?

thanks... eric

(2) By anonymous on 2020-12-12 07:35:31 in reply to 1 [link] [source]

i use NuGet in VS to add the System.Data.SQLite.Core package... so now i have a number of projects that are using different versions of SQLite.

I had the same scruples, see here

If you are using Visual Studio, Tools | NuGet Package Manager | Manage NuGet Package For Solution... allows you to update to the latest version of System.Data.SQLite which is statically linked to version 3.32.1. So, you will ave the same version in all your projects. You do not need to download SQLite3.DLL when using System.Data.SQLite.

I wanted to use SQLite3.DLL version 3.34.0 from my C# project. Using Solution Explorer you can add SQLite3.DLL to your project with property Copy to Output Folder if newer and Visual Studio will copy the file to your bin debug and Release folders.

Then you have two options:

a. Use Pinvoke to use the DLL - your executable will look to its own location to find SQLite3.DLL; therefore you do not need to copy the library to any operating system folder or to modify your operating system PATH.

b. Use the LoadLibrary with GetProcAddress APIs to load SQLite3.DLL from any location on your hard disk.

Either way, it is hard work not least because this library exposes well over 250 functions. Besides, coping with C/C++ strongly typed data is very challenging.

Your computer has other versions of SQLite3.DLL you can search using DIR /s /b SQLite3.DLL from the root of each of your drives (I found 6 other versions).