TypeLoadException with DLL files

Hey guys, I’m getting this mega error when I put the System.Data.dll in my assets folder.

The error:

Does anyone know why?

I’ve since today the exactly same problem:

I need the System.Data.dll to establish a link between unity3D and MySql Database.
When this file is in my “Plugin/MySql/” folder, this message appear in the console, on play (in editor).

I don’t post my error : it’s exactly the same, on each character.

I use Unity3D Pro 3.5 3f3,
with 2 DLL files (concerned by MySql) :

  • System.Data.dll (created on 2010-08-04)
  • MySql.Data.dll (6.2.4.0 on 2010-08-26)

Someone have issues about that ?

Allright !

I’ve found my solution !

  1. Copy the good DLLs
  2. Adapt the code (if necessary)
  3. Copy some other DLLs to be sure that the Connections will works in standalone player.

Explainations :

  1. Copy the good DLLs
  • Copy the “System.Data.dll” from “C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\unity” to the DLL’s folder you use in your project tree
  • Install “MySQL Connector Net 6.5.4”, and when it’s done, copy the “MySql.Data.dll” from “C:\Program Files (x86)\MySQL\MySQL Connector Net 6.5.4\Assemblies\v2.0” to your DLL’s folder in your project tree (don’t copy the v4.0 release of DLL : Unity only use the v2.0).
    NOW you’ve the good DLLs !
  1. Adapt the code (if necessary)
    With that new DLLs, you certainly must update your code.
  1. Copy some other DLLs to be sure that the Connections will works in standalone player.
  • Copy the “I18N.dll”, “I18N.West.dll” from “C:\Program Files (x86)\Unity\Editor\Data\Mono\lib\mono\unity” to the DLL’s folder you use in your project tree
  • (Personaly, i’ve also copied the 4 other “I18N” DLLs - just in case )
    Now, you’re SQL conenction will works in standalone player !

This tip will make your scripts, you know… 20% cooler.

1 Like