2008-10-25

mono+mysql 出现 EntryPointNotFoundException: CreateSemaphore

今天试着在 Mono 中使用 mySql 的连接驱动 "MySql.Data.dll" 时出现异常:

System.EntryPointNotFoundException: CreateSemaphore
at (wrapper managed-to-native) MySql.Data.Common.Semaphore:CreateSemaphore (MySql.Data.Common.SECURITY_ATTRIBUTES&,int,int,string)
at MySql.Data.Common.Semaphore..ctor (Int32 initialCount, Int32 maximumCount) [0x00000]
at (wrapper remoting-invoke-with-check) MySql.Data.Common.Semaphore:.ctor (int,int)
at MySql.Data.MySqlClient.MySqlPool..ctor (MySql.Data.MySqlClient.MySqlConnectionString settings) [0x00000]
at MySql.Data.MySqlClient.MySqlPoolManager.GetPool (MySql.Data.MySqlClient.MySqlConnectionString settings) [0x00000]
at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000]
google 后发现 似乎时需要在连接字符串中设置 "Pooling=false"
private const string CONNECTION_STRING = "server={0};database={1};uid={2};pwd={3};Pooling=false;";
这样就正常了。
原因还不清楚……

//EOF

1 comments:

Anonymous said...

Hi there,

These blog entry help me a lot

thanks ;)