Closed kkbruce closed 4 years ago
I will be checking
I just ran into this as well. On a different note (and I can make it a separate issue if preferred) I'm trying to use this for integration testing and it would be helpful if it could take an existing DbConnection object as an overload.
This is due to HangFire.Storage.SQLite's underlying dependency on the sqlite-net-pcl package, which was built using an older version of SQLitePCL.raw (v1.1 or newer).
SQLitePCL.raw introduced breaking changes in the 2.0 version. (see: Changes in SQLitePCLRaw 2.0)
Microsoft.EntityFrameworkCore.Sqlite (>= 3.0) has a dependency on SQLitePCL.raw v2.0 (or newer)
This version incompatibility between SQLitePCL.raw v1.x and v2.x is causing the issue (see: /sqlite-net/issues/920)
I encountered this same issue recently... As usual, it took 10 times longer to identify the problem than to resolve it.
@kkbruce Since you are using EF Core 3.0, the resolution should be simple. For now, just add the sqlite-net-pcl Nuget package to your project, but specify the "1.7.302-beta" prerelease version of the package. This beta version of sqlite-net-pcl depends on SQLitePCLRaw.bundle_green (>= 2.0.1), and should override the older version of sqlite-net-pcl that is defined by HangFire.Storage.SQLite
@felixclase, While Microsoft.EntityFrameworkCore.Sqlite 3.0+ depends on SQLitePCLRaw v2.0+, Microsoft.EntityFrameworkCore.Sqlite 2.x still depends on SQLitePCLRaw v1.1.12, and is not compatible with v2.0. I'm guessing that EF Core 3.0 support would require a ".NETStandard,Version=2.1" dependency that references "sqlite-net-pcl (>= 1.7.302-beta)", while EF Core 2.2 support would require a ".NETStandard,Version=2.0" dependency that references "sqlite-net-pcl (>= 1.6.292)"
Hope this info helps!
@CallMeOzz
<ItemGroup>
<PackageReference Include="HangFire.Core" Version="1.7.10" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.10" />
<PackageReference Include="Hangfire.Storage.SQLite" Version="0.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.3" />
<PackageReference Include="sqlite-net-pcl" Version="1.7.302-beta" />
</ItemGroup>
It's work. thank you.
I still get the error despite the fact that sqlite-net-pcl 1.7.335 is out and depends of SQLitePCLRaw.bundle_green (>= 2.0.3) but i still get the error.
I'm very new to dotnet but i think we should do a PR to update: https://github.com/raisedapp/Hangfire.Storage.SQLite/blob/e940762efa360274aea6b2e517ed76767e2e3976/src/main/Hangfire.Storage.SQLite/Hangfire.Storage.SQLite.csproj#L37
if so i can do a PR
I add another SQLite provider, like EF Core SQLite to project will throw exception from run project
.UseSQLiteStorage()
.In ASP.NET Core 3.1 API PoC project,
.csproj
startup.cs