Couldn't 'Copy Always' SQLite.Interop.dll Visual Studio 2017 community

0

I am working on a WPF using C# project in Visual Studion 2017 and am able to run the project in development mode perfectly. But after I publish the project I got the error Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found.(Exception from HRESULT: 0x8007007E).

I searched a lot but couldn't find the solution. Many a place people mentioned that to place SQLite.Interop.dll in Debug folder but in my application those dll of x64 and x86 already exists in Debug folder but the next step they said were to change file properties to

Build Action: None and

Copy to output directory: Copy always

But the problem is I could not find these options when I right click on SQLite.Interop.dll. Please help me in this because I am stuck in this right from bunch of hours. Your's help will be greatly appreciated.

c#
wpf
sqlite
interop
asked on Stack Overflow Feb 4, 2019 by Muhammed Ali

1 Answer

0

Step 1: Click Solutions and Folders Button

Step 2: Select Folder View

Step 3: Double Click to Open file with .csproj extension

Step 4: Copy, Paste and save the below code inside <PropertyGroup> tag like given in the Image

<ContentSQLiteInteropFiles>true</ContentSQLiteInteropFiles>
<CopySQLiteInteropFiles>false</CopySQLiteInteropFiles>
<CleanSQLiteInteropFiles>false</CleanSQLiteInteropFiles>
<CollectSQLiteInteropFiles>false</CollectSQLiteInteropFiles>

Step 5: Click Solutions and Folders Button and then SELECT button with .sln option

Step 6: Right click on Project and then SELECT Reload Project

Step 7: If file with .csproj is open then this popup will come and SELECT yes button to close it

And this is how my problem solved after ditching the head for one complete day. I hope this will help someone.

answered on Stack Overflow Oct 30, 2019 by Muhammed Ali

User contributions licensed under CC BY-SA 3.0