0
votes

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.

1
How do you publish your app? Are you using wix, InstallShield? - XAMlMAX
From explore create a Lib folder under your solution, copy the SQLite.Interop.dll file into that. Within VS in the Solution Explorer, right click on Dependencies/References and choose Add Reference and select the SQLite.Interop.dll file. It should then be part of your project and the publish. - Frank Nielsen
@XAMlMAX I published my app in visual studio 2017 by right clicking on my app and selected "Publish" button. I cleaned it before publishing. I am not using wix nor InstallShield. - Muhammed Ali
@FrankNielsen I already solved this issue by following this link stackoverflow.com/questions/32639630/…. But I will also check if your suggestion can help me solve the problem and will reply on that. - Muhammed Ali
For the sake of someone who's stucking in this problem I would like to post the steps I followed to solve it by following the above link. In Visual Studio 2017 Community version. - Muhammed Ali

1 Answers

0
votes

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.