question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DMS 9.0 sync throws The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception.

See original GitHub issue

Was using DMS 0.8.1-beta-0687. Only change is upgrade client and web api to DMS 0.9.0. Also upgraded Microsoft.Data.Sqlite 5.0.8 to 6.0.0 as required by DMS

Stack trace

   at Dotmim.Sync.SyncAgent.<>c__DisplayClass53_0.<<SynchronizeAsync>b__0>d.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Dotmim.Sync.SyncAgent.<SynchronizeAsync>d__53.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Wbl.Services.DataService.<SyncAsync>d__46.MoveNext() in C:\Repos\FREE\Wbl\Services\DataService.cs:line 410

Inner exception stack trace

   at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
   at Dotmim.Sync.Sqlite.SqliteSyncProvider.CreateConnection()
   at Dotmim.Sync.BaseOrchestrator.<RunInTransactionAsync>d__67`1.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Dotmim.Sync.SyncAgent.<>c__DisplayClass53_0.<<SynchronizeAsync>b__0>d.MoveNext()

Rolled back to DMS 0.8.1-beta-0687 and all is tickety-boo

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
bricelamcommented, Dec 8, 2021

This should be fixed in version 6.0.1 of Microsoft.Data.Sqlite (due any day now)

1reaction
vundercommented, Nov 14, 2021

@Mimetis No, I was wrong. 0.9.1 works good in case keeping project Sqlite version 5.0.3. Thanks for quick fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

The type initializer for 'SQLite.SQLiteConnection' threw an ...
I cannot get passed the following starting code without getting the subsequent errors: var db = new SQLiteConnection (dbPath);. Error: The type ......
Read more >
Microsoft.Data.Sqlite.SqliteConnection throws a System. ...
Running an application with Sqlite DB connection throws the following exception: System.TypeInitializationException: The type initializer ...
Read more >
System.TypeInitializationException in Microsoft.Data.Sqlite. ...
TypeInitializationException thrown by Microsoft.Data.Sqlite. ... (orig) /Type initialization for Microsoft.Data.Sqlite.SqliteConnection threw an Exception".
Read more >
System.ArgumentNullException: Value cannot be null in ...
TypeInitializationException : A type initializer threw an exception. To determine which type, inspect the InnerException's StackTrace property.
Read more >
VS2019 the type initializer for 'sqlite.sqliteconnection' threw ...
The application when built from VS2017 run fine. The same solution built on VS2019 throws an exception when accessing Sqlite. the type ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found