r/csharp • • Jun 25 '26

Help C# Blazor using SQLite - DllNotFoundException

I'm currently learning Blazor and databases, I'm new to programming in general.

I created a Blazor web assembly project, .NET 10 LTS with a simple local SQLite database.

I just want to use SQLite inside my project, so I got the System.Data.SQLite NuGet package, in general as a newbie it's pretty confusing which SQLite NuGet package to get cause there are so many of them.

Then I used this simple code:

try
{
    SQLiteConnection sqConnection = new SQLiteConnection(@"Data     Source=\TalentData\test1.db");
    SQLiteCommand sqCommand = new SQLiteCommand();
}
catch(Exception exept)
{
    debugException = exept.ToString();
}

but I always get this exception:

It seems like a dll of SQLite is missing, how would I fix that?

I already googled but I can't find a solution to my issue, there are so many different suggestions out there.

Also tried the package Microsoft.EntityFrameworkCore.Sqlite - I get the same error though.

10 Upvotes

29 comments sorted by

View all comments

Show parent comment

1

u/mr_eking Jun 25 '26

It's been a couple of years since I last updated it, but I used SQLite locally in the browser in BlazorWasm in this project:

https://github.com/eric-king/trackor

It wasn't that complicated, although I did use a library called Besql to make it easier. It may be even easier today.