Peter
Peter

Reputation: 1715

Can't load dll when send application to another PC

I have the following solution:

MySolution
-Project: MyServer (WPF)
-Project: MyClient (WPF)
-Project: MyLibrary (Class library)

Inside MyLibrary, I reference an external DLL System.Data.SQLite for SQLite access. I set the dll to Copy to local so that when I build, it will copy the dll into the directory where the class library MyLibrary will be built into a dll.

In the other two projects (MyClient and MyServer) I reference the class library project so I can have access to my shared routines but also have access to the SQLite libraries. This works great on the dev machine, but when I copy the Release folder to another machine, the Client/server apps refuse to run throwing an error that it can't find the SQLite dll.

What am I doing wrong here ?

Regards

Upvotes: 1

Views: 825

Answers (1)

NotMyself
NotMyself

Reputation: 30057

Check that you have a sqlite.dll in your release folder. You can install i using nuget with the Package Management Console command "Install-Package System.Data.Sqlite".

If you then get a "BadImageFormat" exception, make sure you are using the correct version of sqlite for your system. It comes in 32 and 64-bit flavors.

Upvotes: 3

Related Questions