I am currently trying to create a Visual Studio C # application using SQLite using Visual Studio. I installed SQLite for my program with NuGet, and three recommendations appeared in the solution explorer (System.Data.SQLite, System.Data.SQLite.EF6, System.Data.SQLite.Linq).
When I run my application in VS, everything works fine. However, whenever I publish it (using ClickOnce) and try to run the application, it crashes with the following error:
System.DllNotFoundException: Unable to load the SQLite.Interop.dll DLL: the specified module was not found (exception from HRESULT : 0x8007007E)
After some research, I found this DLL in the Debug folder and copied it to the folder where the ".exe" version of my program was created (after publishing and running "setup.exe"). Thus, the application works well.
But I'm not very happy with this decision, as it seems really dirty. I do not want future users to have to do this manually when they install my application!
So my question is: what can I do to make sure that this DLL is installed with my program?
Note. I tried the first answer of this post:
unable to load sqlite dll interop dll WPF
But I did not seem to work for me.
Thank!