1

I have a project that uses the NuGet package System.Data.Sqlite for accessing the DB.

At compile time all works fine, but at runtime when I initialize the connection this error occurs:

System.DllNotFoundException: SQLite.Interop.dll

I have tried to install the NuGet package System.Data.SQLite.Core but nothing changed.

This error occurs only in Android and iOS device, on UWP all works fine.

How can I solve this?

Anyone has find this error too?

Here a sample project.

Thank you!

Edit:

In that post proposed as solution the package used is sqlite-net-pcl, I use a different package, the System.Data.Sqlite.

This is the package that I use: https://www.nuget.org/packages/System.Data.SQLite

Edit 2:

I've tried to use https://www.nuget.org/packages/sqlite-net-pcl/ and works, but I need to test also https://www.nuget.org/packages/System.Data.SQLite that doesn't works.

5

1 Answer 1

0

I solved using Microsoft.Data.SQLite https://www.nuget.org/packages/Microsoft.Data.SQLite

Sign up to request clarification or add additional context in comments.

3 Comments

Here's a link explaining the difference between: System.Data.SQLite and Microsoft.Data.Sqlite (also mentions Mono.Data.Sqlite) learn.microsoft.com/en-us/dotnet/standard/data/sqlite/compare
Here are some more interesting links about Microsoft.Data.Sqlite. Interoperability with the native SQLite library (uses SQLitePCLRaw): learn.microsoft.com/en-us/dotnet/standard/data/sqlite/interop
And that it's used by the EF Core provider for SQLite: learn.microsoft.com/en-us/dotnet/standard/data/sqlite/… SQLite EF Core Database Provider: learn.microsoft.com/en-us/ef/core/providers/sqlite/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.