Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Void System.Threading.Monitor.Enter Error when using ILMerge

I'm trying to use ILMerge to combine my C# program with 3 referenced DLL's. If I run the program without merging them, everything runs well but when I merge them I get the "Void System.Threading.Monitor.Enter" Error.

Here are the DLL's I am combining:

HTMLAgilityPack.dll
MySql.Data.dll
RKLib.ExportData.dll

The error appears to be coming from the MySql.Data.dll but I am not really sure why it would throw this exception.

Any ideas much appreciated.

EDIT: Full error I am receiving is:

************** 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
like image 585
Reg Avatar asked Nov 12 '22 10:11

Reg


1 Answers

What version of the framework are you using? There is a targetplatform option you may need to set if you are using 4.0/4.5 for example.

/targetplatform:version,platformdirectory

like image 91
Sacrilege Avatar answered Nov 15 '22 04:11

Sacrilege