1

I am doing one WPF application and trying deploy/publish it. As long as i run the application within Visual Studio, everything is fine. But when i am trying separate the deploy files[From Release folder] to antoher location and trying to run, am getting error.

Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I copied App.exe + App.exe.config + System.Data.SQLite.dll files from Release folder.

Additinal Info:

I have installed SQLite Nuget package.

Tried by unchecking prefer 32-Bit and setting Platform to Any CPU in solution properties.

I am new to the WPF, can anybody please correct me if my deploy process or anything else is wrong?

Update:

I also tried by copying all DLL's realted to SQLite to the new location along with solution exe file, but same error is popping up.

List of file, i put together are:

 App.exe
 App.exe.config
 System.Data.SQLite.dll
 System.Data.SQLite.EF6.dll
 System.Data.SQLite.Linq.dll
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
user3966432
  • 378
  • 3
  • 15

6 Answers6

2

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.

Mauro
  • 36
  • 4
0

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

SamTh3D3v
  • 9,854
  • 3
  • 31
  • 47
  • Thanks for your response Joseph, but unfortunately the suggested solution also i tried and it was not working. can you look at updated question. – user3966432 Dec 29 '14 at 15:04
0

Have just solved this in my VS2015 Community WinForms project by:

  1. adding two folders to project root (x86, x84)
  2. copying the x86 and x64 interop dll's into these folders (can get these from bin/debug/x86 and x64.
  3. Then "Add Existing Item" to get the interop dll's included in project in respective folder.
  4. 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.

Dave Tapson
  • 810
  • 1
  • 9
  • 22
0

As the SQLite wiki says, your application deployment must be:

enter image description here

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.

Keltar Helviett
  • 638
  • 1
  • 7
  • 13
-1

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.

CodeNotFound
  • 22,153
  • 10
  • 68
  • 69
Jake Porter
  • 61
  • 1
  • 3
-1

For me, it did not exactly work as Mauro has suggested above (https://stackoverflow.com/a/38611577/1647083).

I got it working by setting the build action to "content".

Community
  • 1
  • 1
mitch182
  • 19
  • 6