user1551454
user1551454

Reputation: 151

Could not load file or assembly SQLitePCLRaw.core

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

Answers (4)

Giobs111
Giobs111

Reputation: 21

In my case removing <assemblyBinding> from app.config resolved the issue

Upvotes: 2

Joseph Wambura
Joseph Wambura

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

Sean
Sean

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

sajjad kalantari
sajjad kalantari

Reputation: 893

i just faced same problem and doing these steps solve it

  1. remove obj and bin folder
  2. run dotnet restore --force

Upvotes: 3

Related Questions