Can't load System.Data.dll

Hello,

I’m pretty new to Unity but starting to understand how it works.

I’ve downloaded the last Unity (2018.1) and changed the scripting runtime version to 4.x.

But I can’t find which System.Data.dll I should include in my project (I need it for my System.Data.SQLite library that I compiled).

If I check in Unity’s folders There are a lot of folders in MonoBleedingEdge/lib/mono : 4.0, 4.0-api, 4.5, 4.5.1-api …

I tried with a few System.Data.dll found in those folders and made sure to use a dll with the same version as the one used to compile my System.Data.SQLite library.

But I always get that “Loading script assembly “Assets/Plugins/System.Data.dll” failed!” when I run my game. Do you know why ? Or is there a possibility to have more details (like version of the dll expected)

Thank you for your help :slight_smile:

Hi,

have you tried going to Player Settings > Other Settings and setting “Api Compatibility Level” to “.NET 2.0”?
By default it’s “.NET 2.0 Subset”.

Thank you for your answer but it doesn’t seem to work.

I’ve also tried to put the one from Visual Studio (linked by default when you create a C# project, the one which is used to compile my System.Data.dll)

Have you found a solution?
I am having the same problem

Does the above help?

I’ve tried that solution myself, but can’t get it to work either

I got it working a few minutes ago, I had to take the System.Data.dll from this path:
“C:\Program Files\Unity\Editor\Data\MonoBleedingEdge\lib\mono\unityjit”

The System.Data.dll in this path tagets 4.X .net and can be added to unity Plugins folder

17 Likes

That fixed my problem too. Thanks!!

That fixed my problem too. Thanks!!!

Thank you so much!

Thanks dude!

You can also go from Unity to edit/Project settings/Player and then look for the Script Runtime version* under Configuration and go to .Net 4.6 or equivalent.

I’ve been looking for hours. Thank you so much.

thank you! That’s Right!

Gracias.
Eso soluciono mi problema.

Thank you! I had this same issue when trying to use System.Drawing.dll and System.Drawing.Design.dll and this solved my build issue

Hello,
What did you do exactly ? I have the same problems, trying to do this tutorial SQLite and Unity: How to do it right. | by Rizwan Asif | Medium but assembly error make me crazy!

So I delete System.Data.dll on C:/user/Program/Unity etc. It works but I find this hack a little dirty ?

1 Like

Hi.
Sorry for the question , but what did you do exactly ?