C# System.Data.SQLite中的扩展未加载:“0”;找不到指定的模块";
我的代码:C# System.Data.SQLite中的扩展未加载:“0”;找不到指定的模块";,c#,sqlite,system.data.sqlite,C#,Sqlite,System.data.sqlite,我的代码: //this is actually a hardcoded path but I shorted it for readability purposes string loc = "libsqlitefunctions.so"; sqlLiteConnection.EnableExtensions(true); sqlLiteConnection.LoadExtension(loc); 我得到的错误是“找不到指定的模块”。但是,运行以下操作: SQLiteCommand cmd
//this is actually a hardcoded path but I shorted it for readability purposes
string loc = "libsqlitefunctions.so";
sqlLiteConnection.EnableExtensions(true);
sqlLiteConnection.LoadExtension(loc);
我得到的错误是“找不到指定的模块”。但是,运行以下操作:
SQLiteCommand cmd = new SQLiteCommand(sqlLiteConnection);
cmd.CommandText = @"select load_extension('" + loc + "');";
cmd.ExecuteNonQuery();
我得到了相同的错误,但是当通过SQLiteStudio运行该命令时,该命令仍然有效:
//Same path as above, cut down for readability purposes
select load_extension('libsqlitefunctions.so');
select cos(radians(45));
这工作正常,并从我尝试加载的扩展附带的cos函数返回一个结果。我可能做错了什么?我开始觉得迷路了。硬编码路径是指绝对路径吗?或者它只是一条较长的相对路径?它是一条绝对路径。编辑:我现在使用绝对值只是为了测试。