Unable to load DLL 'e_sqlite3' on EF Core 2.0
See original GitHub issueI’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:
- Created 6 years ago
- Comments:35 (13 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.@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