我提到了npgsql.dll usign:-r:../../ Bin / Npgsql.dll。 C#程序集不会出现任何错误。
执行以下代码时:
NpgsqlConnection conn = new Npgsql.NpgsqlConnection("Server=localhost;database=myDatabase;uid=myName;password=myPassword;pooling=False;CommandTimeout=60;Timeout=60; Preload Reader = true;");
conn.Open();
我收到以下错误:
Npgsql.NpgsqlConnection doesn't implement interface System.Collections.IEnumerator
Stacktrace:
at Comparator.PairwiseAlignment.fetchData (BaseElements.Sample) <0x0011b>
at Comparator.PairwiseAlignment.initiate (object) <0x00017>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
mono() [0x4983a9]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf030) [0x7f12b9f22030]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f12b9bba475]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x180) [0x7f12b9bbd6f0]
mono() [0x5cfcdf]
mono() [0x5cfd62]
mono() [0x49a06f]
mono() [0x49a784]
[0x4159cbba]
Debug info from gdb:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
值得注意的是,ASP.NET框架完成的程序集在尝试连接数据库时不会导致此错误。但是当我通过命令行手动编译程序时它会这样做。这让我觉得错误可能是由一些兼容性问题引起的。
ASP Web.config包含以下行:
<compilation debug="false" targetFramework="4.0"/>
因此我通过命令行编译&#34; dmcs&#34;模块,代表版本4。
答案 0 :(得分:0)
我错过了名为“Mono.Security.dll”的.dll。
值得注意的是,ASP.NET既未包含此文件也未包含该程序集。系统仍能在没有它的情况下运行..