Hi, first sorry for my English I don’t speak very well, I’ll try my best for you understand me.
So, I’m trying to use dll for connect Unity to SQL (it’s not the problem), I use C#.
I start my script like this :
using UnityEngine;
using System;
using System.Data;
using System.Data.SqlClient;
So Unity send me an error : “‘Data’ does not exist in the namespace ‘System’”.
Here it is ok, I paste the System.Data.dll in the project folder “…/MyProject/Assets/DLLs/”.
Note that I add this version of dll : 4.0.30319.18047 (one of the latest).
So, the error disappear, but now it say : “Could not load type ‘System.Threading.Tasks.Task’ from assembly ‘mscorlib’”.
I make test with Visual Studio and MonoDevelop, the result is…
System.Data.dll make a reference to “System.Threading.Tasks.Task” and say to Unity to search in the .NET 2.0 for the file. Unity found the mscorlib.dll in the folder and… the dll is outdated… effectively “Tasks.Task” doesn’t exist. I watch the .NET 4.0 mscorlib.dll and in this version “Tasks.Task” exist.
So why my dll say to use an outdated version? Why Unity don’t use by itself the latest version? Why I can’t choose my version?
I’ve try to paste the good mscorlib.dll in my “./DLLs/” folder but no effect, I try to include the good dll in the Project Reference no effect or double file error depending on how I arrange the script.
After I think “Hey if you use a anterior version of System.Data.dll probably it’s doesn’t search for Tasks.Task”. And a lot of error appear.
Am I damned?
Someone can help me?
Thank you, it work instantly. Want to up vote but can't before 15 reputation, thank you :D.
– Silen.S.Sin@silenssin: Don't post comments as answers! I've converted your answer into a comment. Next time use the "add new comment" button or your "answers" will get downvoted. Instead of posting a comment / answer you should accept the answer if it solved your problem. <img src="https://dl.dropboxusercontent.com/u/7761356/UnityAnswers/Images/HowToTickAnAnswer.PNG">
– Bunny83Agree with @Bunny83 - users have to accept good answers. This way the whole Unity community can benefit.
– ArkaneXThis answer don't fix the problem in Unity 5.3.2 :( Somebody has a solution?
– tomytomas93