Closed middiu closed 2 years ago
worked for me with explicitly adding SQLitePCLRaw.lib.e_sqlcipher
to the project deps
@simonbuehler Could you elaborate on that pls? How exactly did you add e_sqlcipher to your projects deps?
as a explicit nuget dep https://www.nuget.org/packages/SQLitePCLRaw.lib.e_sqlcipher/
To clarify my Situtaton: I'm also developing an VSTO Excel Add in on .net Framework 4.7.2.
my installed packages can be seen in packages.config:
<packages>
<package id="Microsoft.Data.Sqlite" version="5.0.5" targetFramework="net472" />
<package id="Microsoft.Data.Sqlite.Core" version="5.0.5" targetFramework="net472" />
<package id="SQLitePCLRaw.bundle_e_sqlcipher" version="2.0.3" targetFramework="net472" />
<package id="SQLitePCLRaw.bundle_e_sqlite3" version="2.0.4" targetFramework="net472" />
<package id="SQLitePCLRaw.core" version="2.0.4" targetFramework="net472" />
<package id="SQLitePCLRaw.lib.e_sqlcipher" version="2.0.3" targetFramework="net472" />
<package id="SQLitePCLRaw.lib.e_sqlite3" version="2.0.4" targetFramework="net472" />
<package id="SQLitePCLRaw.provider.dynamic_cdecl" version="2.0.4" targetFramework="net472" />
<package id="System.Buffers" version="4.4.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.3" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
</packages>
the reference part of my .vbproj looks like follwing:
<!--
This section specifies references for the project.
-->
<ItemGroup>
<Reference Include="Accessibility" />
<Reference Include="Microsoft.Data.Sqlite, Version=5.0.5.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Sqlite.Core.5.0.5\lib\netstandard2.0\Microsoft.Data.Sqlite.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.batteries_v2, Version=2.0.4.976, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.bundle_e_sqlite3.2.0.4\lib\net461\SQLitePCLRaw.batteries_v2.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.core, Version=2.0.4.976, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.core.2.0.4\lib\netstandard2.0\SQLitePCLRaw.core.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.nativelibrary, Version=2.0.4.976, Culture=neutral, PublicKeyToken=502ed628492ab262, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.bundle_e_sqlite3.2.0.4\lib\net461\SQLitePCLRaw.nativelibrary.dll</HintPath>
</Reference>
<Reference Include="SQLitePCLRaw.provider.dynamic_cdecl, Version=2.0.4.976, Culture=neutral, PublicKeyToken=b68184102cba0b3b, processorArchitecture=MSIL">
<HintPath>..\packages\SQLitePCLRaw.provider.dynamic_cdecl.2.0.4\lib\netstandard2.0\SQLitePCLRaw.provider.dynamic_cdecl.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
upon opening an database connection like this:
Dim connect As SqliteConnection
Dim SQLcommand As SqliteCommand
Dim builder As New SqliteConnectionStringBuilder
builder.DataSource = "D:\path\to\db"
builder.Password = "pw"
connect = New SqliteConnection(builder.ConnectionString)
connect.Open()
an Exception occurs "TargetInvocationException" with "Exception: Library e_sqlite3 not found"
The bin folder looks like this. In runtimes there is e_sqlcipher.dll:
ExcelAddIntestEncryptSql.dll
│ ExcelAddIntestEncryptSql.dll.manifest
│ ExcelAddIntestEncryptSql.pdb
│ ExcelAddIntestEncryptSql.vsto
│ ExcelAddIntestEncryptSql.xml
│ Microsoft.Data.Sqlite.dll
│ Microsoft.Data.Sqlite.xml
│ Microsoft.Office.Tools.Common.v4.0.Utilities.dll
│ SQLitePCLRaw.batteries_v2.dll
│ SQLitePCLRaw.core.dll
│ SQLitePCLRaw.nativelibrary.dll
│ SQLitePCLRaw.provider.dynamic_cdecl.dll
│ System.Buffers.dll
│ System.Buffers.xml
│ System.Memory.dll
│ System.Memory.xml
│ System.Numerics.Vectors.dll
│ System.Numerics.Vectors.xml
│ System.Runtime.CompilerServices.Unsafe.dll
│ System.Runtime.CompilerServices.Unsafe.xml
│
└───runtimes
├───win-arm
│ └───native
│ e_sqlcipher.dll
│ e_sqlite3.dll
│
├───win-x64
│ └───native
│ e_sqlcipher.dll
│ e_sqlite3.dll
│
└───win-x86
└───native
e_sqlcipher.dll
e_sqlite3.dll
The exact same Setup works if the project is a WinForms Project. But not for an VSTO Add In.
I tried adding a refernce via the reference-manager to e_sqlcipher.dll but visual studio won't let me.
Any help is appreciated :)
Try to copy the e_sqlite.dll in your root folder
I already tried this. Sadly it doesn't work for me ....
Closing old/stale issue.
Hello,
I would need to get some help in making SQLitePCL working in my .net461 WebApi application.
I execute SQLitePCL.Batteries_V2.Init(); as the beginning of my app inside my Global.asax.cs file but I keep getting the error:
this is the packages.conf file:
and this is my csproj file:
any help is appreciated.