Could not load file or assembly 'System.Data.SQLite, Version=1.0.115.5

fullofquestions231 21 Reputation points
2022-03-14T12:00:15.813+00:00

Hi there, I have created a wpf app for the production team at work and everything runs ok on my computer.

I have the apps .exe file saved on a server but when a production computer runs the .exe file they get the below error. I have seen similar questions e.g could-not-load-file-or-assembly-system-data-sqlite-version-1-0-115-5but haven't been able to fix the issue yet.

Below is the error and what I see in my packages.config file


Error : System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.115.5, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Data.SQLite, Version=1.0.115.5, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
at CSV_Generator_App.mainForm.querySqlDB(String sqlDBpath)
at CSV_Generator_App.mainForm.txtScannedValue_TextChanged(Object sender, EventArgs e)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

<?xml version="1.0" encoding="utf-8"?>

<packages>
<package id="Dapper" version="2.0.123" targetFramework="net472" />
<package id="EntityFramework" version="6.4.4" targetFramework="net472" />
<package id="NLog" version="4.7.14" targetFramework="net472" />
<package id="SQLite" version="3.13.0" targetFramework="net472" />
<package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.115.5" targetFramework="net472" />
<package id="System.Data.SQLite" version="1.0.115.5" targetFramework="net472" />
<package id="System.Data.SQLite.Core" version="1.0.115.5" targetFramework="net472" />
<package id="System.Data.SQLite.EF6" version="1.0.115.5" targetFramework="net472" />
<package id="System.Data.SQLite.Linq" version="1.0.115.5" targetFramework="net472" />

</packages>

EDIT:
When I save the whole solution folder to the server it solves the problem however I don't the whole solution and code available to the end user.

Is there a specific file/assembly that needs to be saved or added to the .exe or a better way of delivering the app to the user??

Developer technologies | Windows Presentation Foundation
SQL Server | Other
Developer technologies | C#
{count} votes

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2022-03-14T15:05:03.367+00:00

    The error indicates that when you deployed the app to your server then you were missing System.Data.SQLite. Ensure that binary is on the machine that you deploy it to.

    You didn't specify how you're deploying your app but you should be able to xcopy the folder with your executable and any child folders. If you're using another deployment method then ensure that whatever deployment package is produced has the necessary files.

    If the file is there then check the version #. You have several packages related to SQLite and it is possible you have mixed versions. The last version written wins so if it happens to be an older version then you can also get an error.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.