Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# System.Data.SQLite中的扩展未加载:“0”;找不到指定的模块";_C#_Sqlite_System.data.sqlite - Fatal编程技术网

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函数返回一个结果。我可能做错了什么?我开始觉得迷路了。

硬编码路径是指绝对路径吗?或者它只是一条较长的相对路径?它是一条绝对路径。编辑:我现在使用绝对值只是为了测试。