问题
I have a WinForms project that is using System.Data.SQLite.Core with VS 2019 ver 16.7.2 with Net,Framework 4.8.03761
On a Windows 7 64 bit computer
I will post a screen shot of my NuGet configuration I have used both PackageReference and Packages.config
Here is the error after trying to run the installed project The EXE and MSI are created no error
************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly
'System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'or one of its dependencies.
The system cannot find the file specified.File name: 'System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'
Here is the code in the Setup vd.proj
"AssemblyRegister" = "3:1"
"AssemblyIsInGAC" = "11:FALSE"
"AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_C5DB47242F8741C810DFEFD880A7C5EE"
{
"Name" = "8:System.Data.SQLite.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.Data.SQLite.dll"
"TargetName" = "8:"
"Tag" = "8:"
"Folder" = "8:_7BDF17F7B5204D1F874F701BF2CA978A"
"Condition" = "8:"
"Transitive" = "11:FALSE"
"Vital" = "11:TRUE"
"ReadOnly" = "11:FALSE"
"Hidden" = "11:FALSE"
"System" = "11:FALSE"
"Permanent" = "11:FALSE"
"SharedLegacy" = "11:FALSE"
"PackageAs" = "3:1"
"Register" = "3:1"
"Exclude" = "11:FALSE"
"IsDependency" = "11:TRUE"
"IsolateTo" = "8:"
}
Here is the relevant code in the PROJECT vb.proj
<ItemGroup>
<PackageReference Include="System.Data.SQLite.Core">
<Version>1.0.113.1</Version>
</PackageReference>
I have not noticed this before but why is the SETUP.proj named vd.proj and the PROJECT named vb.proj
My Question is what needs to be changed and where to change it so the app will run?
I have spent two weeks trying various fixes even sent a zip file to Visual Studio Developer Community
They installed and ran the project on their machine with no errors!
I have also built a test project WITHOUT System.Data.SQLite.Core it creates a working app when installed
I as well tried removing System.Data.SQLite.Core and using System.Data.SQLite Same Errors
I also created EXE and MSI files using Inno Setup that Fails as well
FWIW the project runs in development mode no issues
Thought of changing this in C:\Windows\assembly NOT Brave enough I do not trust making this change
For anyone trying to answer this question I have been able to prove that the two dll files System.Interop.dll and System.Data.SQLite.dll are NOT being included when using the process of adding a Setup Project I made some adjustment to my Inno Setup.iss File Code is posted below
This is not a Solution but it may help trying to answer the question
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
来源:https://stackoverflow.com/questions/63679859/file-not-found-error-system-data-sqlite-version-1-0-113-0