Can't open Sqlite database in read-only mode Can't open Sqlite database in read-only mode sqlite sqlite

Can't open Sqlite database in read-only mode


You found a bug in Mono.Data.Sqlite.dll.

The Create flag is appended (by default) before the ReadOnly flag is parsed and set. The resulting flag is invalid and sqlite reports an error.

I will fix this for future releases (of Mono and MonoTouch...). If this blocks you then please open a bug report on http://bugzilla.xamarin.com and I'll attach a fixed assembly (with instructions to replace the existing one) to the bug report.


This worked for me (aspnet core):

var _conn = new SqliteConnection("Data Source=db/sampleDb;mode=ReadOnly");


Have you tried?:

var _conn = new SqliteConnection("Data Source=db/sampleDb;mode=ro");