Unable To Load Dll Sqlite Interop Dll Wpf
Solution 1:
In Solution Explorer click with right button on the name project and choose
ADD -> Existing Item
. Then change your search to All Files (*.*)
and open the Sqlite.Interop.dll
. You can find it in bin\debug\x86 (or x64)
Now you have the dll in you project (if you right click on it, you can see "Build action = content"). Change it in "Build Action = Embedded Resource".
Re-publish and that's all.
Solution 2:
Make sure also that those dlls are present where the exe is:
System.Data.SQLite.dll
System.Data.SQLite.EF6.dll
System.Data.SQLite.Linq.dll
if no copy them from the debug folder
Solution 3:
Have just solved this in my VS2015 Community WinForms project by:
- adding two folders to project root (x86, x84)
- copying the x86 and x64 interop dll's into these folders (can get these from bin/debug/x86 and x64.
- Then "Add Existing Item" to get the interop dll's included in project in respective folder.
- Right-click on each dll in project folder and choose 'content' and 'always copy'.
This is all from memory, so adjust accordingly.
Had tried all sorts of other options, none of which worked.
Solution 4:
As the SQLite wiki says, your application deployment must be:
So you need to follow the rules. Find dll that matches your target platform and put it in location, describes in the picture. Dlls can be found in YourSolution/packages/System.Data.SQLite.Core.%version%/.
I had problems with application deployment, so I just added right SQLite.Interop.dll into my project, the added x86 folder to AppplicationFolder in setup project and added file references to dll.
Solution 5:
Mauro's answer works great. Other then the 64 interop.dll didn't work for me. You also will need to change copy to output directory to copy always or if newer version. You can then leave the any cpu if you do the 86 and leave the perfer 32.
Post a Comment for "Unable To Load Dll Sqlite Interop Dll Wpf"