question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load DLL 'e_sqlite3' on EF Core 2.0

See original GitHub issue

I’m testing my code using sqlite in memory database and I get this error when trying to run a test.

System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'e_sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Further technical details

EF Core version: 2.0.0 Database Provider: Microsoft.EntityFrameworkCore.Sqlite Operating system: Visual Studio 2017

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:35 (13 by maintainers)

github_iconTop GitHub Comments

8reactions
bricelamcommented, Nov 2, 2017

Is everyone here using a separate class library for their DbContext? If so, the solution to the original issue is to add a reference to SQLitePCLRaw.bundle_green to the consuming app/test projects. This is just a known/by-design limitation of how NuGet handles transitive references.

4reactions
giri-niteshcommented, Jun 27, 2019

@bricelam, @ajcvickers I am still facing this issue even after trying all the answers in this thread. Does this issue still persist in later builds ? I am also using Sqlite db for unit testing with specflow.

Technical Details: Microsoft.EntityFrameworkCore 2.2.4 Microsoft.Data.Sqlite.Core 2.2.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - .Net Core 2.0 SQLite3 "Unable to load DLL 'e_sqlite3'"
However, when I finished implementing the Sqlite code to my app, I deployed to IIS again, and found that nothing is working. Mainly...
Read more >
Weirdness with EF Core 2 (SQLite), .NET Standard, and . ...
This indicates that we're missing a DLL that's needed for SQLite functionality. If we check the output folder, we see that we have...
Read more >
Web service: Unable to load DLL 'sqlite3': The specified ...
I have created a webservice in C# using visual studio 2015 and the Devart ado.net connector for SQLite. ... I have two folders...
Read more >
Unable to load DLL 'e_sqlite3' on EF Core 2.0 -
I'm testing my code using sqlite in memory database and I get this error when trying to run a test. System.TypeInitializationException: The ...
Read more >
Unable to load DLL SQLite.Interop.dll - YouTube
Trying to connect SQLite database with a c# .Net application in Visual Studios 2019 with the following error System.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found