Deployment project with SQLite on end-user machines
SQLite has good documentation, but neet a time to carefully read it. Main problem in SQL - it working with different library in developer and end-user machine. Without this understanding you will receive only error:
This problem is induce by mixed-mode SQLite-assembly SQLite3.dll and SQLite.Interop.dll and main point to confusion is a lot and incomprehensible SQLite packages in Nuget.
For example if you add to project only four library:
1: <?xml version="1.0" encoding="utf-8"?>
2: <packages>
3: <package id="AutoClosingMessageBox" version="1.0.0.2" targetFramework="net48" />
4: <package id="EntityFramework" version="6.4.0" targetFramework="net46" />
5: <package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net48" />
6: <package id="Microsoft.IdentityModel.JsonWebTokens" version="5.6.0" targetFramework="net48" />
7: <package id="Microsoft.IdentityModel.Logging" version="5.6.0" targetFramework="net48" />
8: <package id="Microsoft.IdentityModel.Tokens" version="5.6.0" targetFramework="net48" />
9: <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
10: <package id="System.Configuration.ConfigurationManager" version="4.7.0" targetFramework="net48" />
11: <package id="System.Data.SQLite" version="1.0.112.0" targetFramework="net48" />
12: <package id="System.Data.SQLite.Core" version="1.0.112.0" targetFramework="net48" />
13: <package id="System.Data.SQLite.EF6" version="1.0.112.0" targetFramework="net48" />
14: <package id="System.Data.SQLite.Linq" version="1.0.112.0" targetFramework="net48" />
15: <package id="System.IdentityModel.Tokens.Jwt" version="5.6.0" targetFramework="net46" requireReinstallation="true" />
16: <package id="System.Security.AccessControl" version="4.7.0" targetFramework="net48" />
17: <package id="System.Security.Permissions" version="4.7.0" targetFramework="net48" />
18: <package id="System.Security.Principal.Windows" version="4.7.0" targetFramework="net48" />
19: <package id="TA-Lib" version="0.5.0.3" targetFramework="net48" />
20: </packages>
You will receive a similar file structure.
And this project will be working fine, but only with computer with Visual Studio!
But if you include to the same project another package SQLitePCLRaw.bundle_green, you receive another package.config
1: <?xml version="1.0" encoding="utf-8"?>
2: <packages>
3: <package id="AutoClosingMessageBox" version="1.0.0.2" targetFramework="net48" />
4: <package id="EntityFramework" version="6.4.0" targetFramework="net48" />
5: <package id="Microsoft.AspNet.WebApi.Client" version="5.2.7" targetFramework="net48" />
6: <package id="Microsoft.IdentityModel.JsonWebTokens" version="5.6.0" targetFramework="net48" />
7: <package id="Microsoft.IdentityModel.Logging" version="5.6.0" targetFramework="net48" />
8: <package id="Microsoft.IdentityModel.Tokens" version="5.6.0" targetFramework="net48" />
9: <package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
10: <package id="SQLitePCLRaw.bundle_green" version="2.0.2" targetFramework="net48" />
11: <package id="SQLitePCLRaw.core" version="2.0.2" targetFramework="net48" />
12: <package id="SQLitePCLRaw.lib.e_sqlite3" version="2.0.2" targetFramework="net48" />
13: <package id="SQLitePCLRaw.provider.dynamic_cdecl" version="2.0.2" targetFramework="net48" />
14: <package id="System.Buffers" version="4.4.0" targetFramework="net48" />
15: <package id="System.Configuration.ConfigurationManager" version="4.7.0" targetFramework="net48" />
16: <package id="System.Data.SQLite" version="1.0.112.0" targetFramework="net48" />
17: <package id="System.Data.SQLite.Core" version="1.0.112.0" targetFramework="net48" />
18: <package id="System.Data.SQLite.EF6" version="1.0.112.0" targetFramework="net48" />
19: <package id="System.Data.SQLite.Linq" version="1.0.112.0" targetFramework="net48" />
20: <package id="System.IdentityModel.Tokens.Jwt" version="5.6.0" targetFramework="net48" />
21: <package id="System.Memory" version="4.5.3" targetFramework="net48" />
22: <package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net48" />
23: <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net48" />
24: <package id="System.Security.AccessControl" version="4.7.0" targetFramework="net48" />
25: <package id="System.Security.Permissions" version="4.7.0" targetFramework="net48" />
26: <package id="System.Security.Principal.Windows" version="4.7.0" targetFramework="net48" />
27: <package id="TA-Lib" version="0.5.0.3" targetFramework="net48" />
28: </packages>
And another folder structure with additionally folder runtime what contains e_sqlite3.dll
Also all dependency referenced assembly will be different. Instead System.Xml.Linq.dll, System.Deployment.dll, System.Data.OracleClient.dll, System.Data.DataSetExtensions.dll you will receive System.Buffers.dll, System.Memory.dll, System.Numerics.dll, System.Runtime.CompilerServices.Unsafe.dll and additionally 7 libraries with SQLite (SQLitePCLRaw.batteries_v2.dll, SQLitePCLRaw.core.dll, SQLitePCLRaw.nativelibrary.dll, SQLitePCLRaw.provider.dynamic_cdecl.dll and three version of e_sqlite3.dll).
|