Void System.Threading.Monitor.Enter使用ILMerge时出错

Reg*_*Reg 5 c# ilmerge visual-studio-2010

我正在尝试使用ILMerge将我的C#程序与3个引用的DLL结合起来.如果我运行程序而不合并它们,一切运行良好,但当我合并它们时,我得到"Void System.Threading.Monitor.Enter"错误.

这是我正在组合的DLL:

HTMLAgilityPack.dll
MySql.Data.dll
RKLib.ExportData.dll
Run Code Online (Sandbox Code Playgroud)

错误似乎来自MySql.Data.dll但我不确定为什么会抛出此异常.

任何想法都非常感激.

编辑:我收到的完整错误是:

************** Exception Text **************
System.MissingMethodException: Method not found: 'Void System.Threading.Monitor.Enter(System.Object, Boolean ByRef)'.
at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(String value)
at MySql.Data.MySqlClient.MySqlConnection..ctor(String connectionString) in :line 0
Run Code Online (Sandbox Code Playgroud)

Sac*_*ege 1

您使用什么版本的框架?例如,如果您使用 4.0/4.5,则可能需要设置一个目标平台选项。

/targetplatform:version,platformdirectory