Unable to load shared library - MacOS x64
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 215
- Avg merge
- 4h 2m
- Merged PRs (30d)
- 1
Description
OS: Mac OS 11.6.5 (Intel x86-64)
Installed latest version of Azure Functions Core tools. (v4)
Using Microsoft.Data.Sqlite in azure functions project with HTTP trigger.
When attempting to connect to Database receiving following error:
`System.Private.CoreLib: Exception while executing function: test. 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. SQLitePCLRaw.provider.e_sqlite3: Unable to load shared library 'e_sqlite3' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libe_sqlite3, 1): image not found.`
Same project works fine in Windows 11.
A simple console app also works fine in MacOS using same SQLite DB and libs.
Therefore, I believe it's the azure function tools
Easily re-produced by creating new azure func app - http trigger, add package 'Microsoft.Data.Sqlite'.
Try to open a database:
`[FunctionName("test")]
public static async Task RunAsync(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log)`
` {
log.LogInformation("C# HTTP trigger function processed a request.");
using (var dbConn = new SqliteConnection("Data Source=database.db"))
{
dbConn.Open();
dbConn.Close();
return new OkObjectResult("OK!");
}
}`
Apologies in advance if anything omitted - this is my first bug report. Happy to provide any further info.
EDIT: Just tested in Linux PopOS 2110. Same issue occurs.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.