Skip to content

Commit

Permalink
Manually initialize the SQLitePCLRaw bundles before calling into Micr…
Browse files Browse the repository at this point in the history
…osoft.Data.Sqlite (#20)

Co-authored-by: Brad White <bradselw@pm.me>
  • Loading branch information
bradselw and Brad White committed May 4, 2023
1 parent 2d52f13 commit 7ae1dcb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SystemStateManager.Persistence/SqliteConnectionFactory.cs
Expand Up @@ -35,10 +35,14 @@ public static SqliteConnection Create()
}
}

// In some cases, we need to manually initialize the SQLitePCLRaw bundles before calling into Microsoft.Data.Sqlite
SQLitePCL.Batteries_V2.Init();

var connectionString = new SqliteConnectionStringBuilder
{
DataSource = DatabaseFile.FullName,
}.ToString();

var connection = new SqliteConnection(connectionString);
connection.Open();

Expand Down

0 comments on commit 7ae1dcb

Please sign in to comment.