Reputation: 151
I am using Microsoft.EntityFrameworkCore.Sqlite version 2.2.4 Microsoft.EntityFrameworkCore version 2.2.4 nuget packages on my .net core class library.
When adding my class library to Console application I am getting the following exception: FileNotFoundException: Could not load file or assembly 'SQLitePCLRaw.core, Version=1.1.12.351, Culture=neutral, PublicKeyToken=1488e028ca7ab535'. The system cannot find the file specified.
My code is running on windows but will also run on Linux.
Is there any solution?
I saw a recommendation for adding Microsoft.EntityFrameworkCore.Sqlite nuget to my console application. but I prefer avoiding this solution.
Upvotes: 8
Views: 7526
Reputation: 21
In my case removing <assemblyBinding>
from app.config
resolved the issue
Upvotes: 2
Reputation: 3406
I had to Downgrade to a lower version.
<PackageReference Include="sqlite-net-pcl" Version="1.6.292" />
<!--<PackageReference Include="sqlite-net-pcl" Version="1.8.116" />-->
Upvotes: 2
Reputation: 2119
Just had this issue - something had set AutoGenerateBindingRedirects to false in my .csproj file. Reverting it back to true fixed it.
Upvotes: 0
Reputation: 893
i just faced same problem and doing these steps solve it
dotnet restore --force
Upvotes: 3