linux.net-coresystem.data.sqlite

Does the .Net Core System.Data.Sqlite library work on a Linux environment?


I am using the System.Data.SQLite package in a .Net core app. The dll runs fine in a Windows environment.

It does not run in Linux (Ubuntu 20.04).

I have tried the following versions:

  • version 1.0.03.0
  • version 1.0.113.7

I get the following error message:

Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'. The located assembly's manifest definition does not match the assembly reference. (0x80131040) File name: 'System.Data.SQLite, Version=1.0.113.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139'

What do I need to do to make this run in Linux?


Solution

  • using Microsoft.Data.Sqlite (≥.Net6) works for me, both windows and linux.

    dotnet add package Microsoft.Data.Sqlite --version 6.0.13