Home

Built-in EF Core driver not finding Microsoft.Data.Sqlite.dll

edited May 11

I created a connection to an SQLite db file using the latest (3.1.2) built-in EF Core driver but it isn't working. Connection test results in

Error Testing EF Core Connection: Unable to resolve database provider assembly 'Microsoft.Data.Sqlite.dll'

The only copy of that dll on my PC is C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All\2.1.17\Microsoft.Data.Sqlite.dll

This is on LINQPad 6.7.5 (X64) installed via Chocolatey in case that is significant.

Comments

  • Can you please right-click the connection, select "Show assembly resolution log", and paste the output.

  • Looks pretty unreadable pasted as text so printed to PDF and attached that.

  • I can only guess that the NuGet packages for SQLite or EF Core have partially downloaded. Can you try closing LINQPad and deleting the following folders:

    c:\users\steve.nuget\packages
    c:\users\steve\appdata\local\LINQPad\NuGet.NetCore
    c:\users\steve\appdata\local\LINQPad\NuGet.NetCore.PerfCache
    c:\users\steve\appdata\local\LINQPad\NuGet.NetCore.Supporting

    and then re-start LINQPad. Right-click the connection and press 'Test'. It should prompt you to download the NuGet packages for SQLite.

    (Note that this will also delete your NuGet package reference cache for Visual Studio; it should automatically restore the relevant packages when you re-open the projects.)

  • Thanks Joe, that has indeed fixed the problem.

Sign In or Register to comment.