Click here to Skip to main content
14,669,432 members
Rate this:
Please Sign up or sign in to vote.
I have used the Setup Project before and it worked on a project that did not have System.Data.SQLite.Core installed So Now I am trying to create the EXE and MSI files using the same steps.

Solution Explore Looks Like this
Detected Dependencies
MS Net Framework
Primary output from Notebook (Active)
Primary output from Notebook (Active)
Primary output from Notebook (Active)

I am suing a W 7 64 bit machine and I am guessing for some reason VS 2019 is a 32 bit program ? I am trying to do the Builds as x64

I will post the ERROR log file
My Package Management is Package Reference
Allow NuGet to download missing packages is UN-checked I have tried BUILD with this checked and UN-checked as well as package.Config per this SO Post
installation - How to make Visual Studio Setup Project detect nuget dependencies consistent with build? - Stack Overflow[^]

Here is the ERROR Log File
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
at Notebook.frmStart.makeDB()
at Notebook.frmStart.btnCreate_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

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].

************** Loaded Assemblies **************
Assembly Version:
Win32 Version: 4.8.4069.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
Assembly Version:
Win32 Version:
CodeBase: file:///C:/Users/Dwight/Desktop/Notebook.exe
Assembly Version:
Win32 Version: 14.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
Assembly Version:
Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
Assembly Version:
Win32 Version: 4.8.4110.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
Assembly Version:
Win32 Version: 4.8.4042.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
Assembly Version:
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
Assembly Version:
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
Assembly Version:
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
Assembly Version:
Win32 Version: 4.8.3761.0 built by: NET48REL1
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the section.
The application must also be compiled with debugging

For example:

configuration jitDebugging="true"

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

What I have tried:

I have tried more to follow same Build steps that worked for project without SQLite
I have this Import statement in all forms
Imports System.Data.SQLite
Updated 4-Sep-20 7:13am

Rate this:
Please Sign up or sign in to vote.

Solution 1

System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SQLite, Version=, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies. The system cannot find the file specified.

You don't the version of the assembly that is referenced in your project.

Find the assembly version that is present on the system (assuming things are in place installed). Notice the difference. Now, once you have located the assembly, use this in your project as a reference instead of the current version v1.0.113.0

Imports is using the namespace and the issue is more related to locating the assembly first.
Choroid 23-Aug-20 12:52pm
@SandeepMewara Little confused assembly version on the system How to Find SQLite on system I have never used it except in VS 2019 I guess a global search of Drive C Holly Crap SQLite is every where I have perhaps a Kotlin project that uses it I also have DB Browser that uses it AND Adobe Reader ? Need better search term like SQLite dll ?
Sandeep Mewara 23-Aug-20 13:19pm
Well, if its about the Visual studio install, you should find somewhere in Program Files.

Alternate, try this first:
1. Remove the current reference if any.
2. Use Buget: and then refer the version 1.0.113 from there. This should solve right away.
Choroid 23-Aug-20 13:57pm
See My Next two comments
Choroid 23-Aug-20 13:42pm
@SandeepMewara so VS 2019 has SQLite.Interop.dll v under C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\PrivateAssemblies\x86 and x64 What do I need to change ? And Where do I need to change OTHER Interop.dll have for System.Data.SQLite.Core have v1.0.113.0
Choroid 23-Aug-20 13:45pm
@SandeepMewara I tried that alternative using System.Data.SQLite NO CORE no results same ERROR See my comment above
Sandeep Mewara 23-Aug-20 14:03pm
Either your project is referring that version or some third party you are using is. I am not sure why nuget did not work for you - it seems tohave the version your project is looking for.
Choroid 23-Aug-20 14:28pm
I see some other third party apps Adobe v11.0.0.379 AOMEI backup sqlite3.dll DB Browser sqlite2.dll no version BIG concern is VS x64 and x86 SQLite.Interop.dll ver I see this as a BUG if the Interop is the offending dll
Rate this:
Please Sign up or sign in to vote.

Solution 2

After 3 weeks of back and forth with Microsoft Developer Community and a very intense exchange of files and offered solutions from MDC that did not work
I have dusted off old brain cells from my days with VB 6 and what we called dll HELL

I Opened up Inno Setup current version and wrote a Setup.iss file YES
I now have a working EXE file for my Visual Studio 2019 WinForms project developed on a Windows 7 64 bit machine
Is this a Solution Yes and No
Yes it works and accomplishes the task
No IMHO MS has always had issues with installers
I guess that is why there are so many third party installers FREE and PAID

Relevant Code Below

Source: "C:\Users\Dwight\source\repos\TestDiary\TestDiary\bin\Debug\TestDiary.exe"; DestDir: "{app}";Flags: ignoreversion
Source: "C:\Users\Dwight\source\repos\TestDiary\TestDiary\bin\Debug\x64\*"; DestDir: "{app}";Flags: ignoreversion
Source: "C:\Users\Dwight\source\repos\TestDiary\TestDiary\bin\Debug\x86\*"; DestDir: "{app}";Flags: ignoreversion
Source:"C:\Users\Dwight\source\repos\TestDiary\TestDiary\bin\Debug\System.Data.SQLite.dll";DestDir: "{app}";Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100