Sqlite Connection issue with Azure Function

Lots of Developers might have noticed that SQLite doesn't connect with Azure Function straightforward.

You mush have noticed Azure function host complains about missing e_sqlite3.dll.
Most noticeable error message:

[26/07/2020 10:40:25 AM] Executed 'UpdateMF' (Failed, Id=67777b37-d1ff-4c01-90e3-155e29b9b606)
[26/07/2020 10:40:25 AM] Microsoft.Data.Sqlite: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. System.Private.CoreLib: Exception has been thrown by the target of an invocation. System.Private.CoreLib: Unable to load DLL 'e_sqlite3' or one of its dependencies: The specified module could not be found. (0x8007007E).
[26/07/2020 10:40:25 AM] An unhandled host error has occurred.
[26/07/2020 10:40:25 AM] Microsoft.Data.Sqlite: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. System.Private.CoreLib: Exception has been thrown by the target of an invocation. System.Private.CoreLib: Unable to load DLL 'e_sqlite3' or one of its dependencies: The specified module could not be found. (0x8007007E).


The Solution to this issue is copy dll 'e_sqlite3.dll' to "..\bin\Debug\netcoreapp3.1\bin" folder


It resolved my issue hoping it resolves yours too.
Please let me know your thoughts/outcomes..


Comments

Popular Posts