【问题标题】:MySQL.Data.dll error in monodevelop in Debian monoDebian mono 中的 monodevelop 中的 MySQL.Data.dll 错误
【发布时间】:2026-01-12 03:10:01
【问题描述】:

应用程序最初是在 VS 2008 中开发的。它使用 MySQL.data.dll 连接到 MySQL 数据库。应用程序在 Windows 中运行良好。

但生产环境是带有单声道的 Debian。

现在将整个解决方案复制到 Debian 盒子中。整个解决方案在 monodevelop 中正确打开。它不会在构建中引发任何错误。但是在运行时 - 它会引发以下错误 -

文件发送中............

Error: 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] 

【问题讨论】:

    标签: mysql mono debian monodevelop


    【解决方案1】:

    信号量(如此处使用的)是一个仅限 Windows 的功能。我猜你需要一个专门与 Mono 兼容的客户端版本。您可能想查看MySQL section of the Mono site 并从那里开始。

    【讨论】:

      【解决方案2】:

      谢谢。我也可以找到问题。需要最新版本的 MySQL 连接器。连接字符串中还需要Pooling=false。

      【讨论】:

      • 如果我给出的答案有帮助,您应该点赞/接受! :)