Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm using Visual Studio for my Unity project. (Unity is using mono framework, NOT .net). I'm using a database so I have to use System.Data.dll in the project which i'm keeping in Assets/Plugins folder:

enter image description here

As you can see Visual Studio has problems seeing System.Data library. So I'm hardcoding:

enter image description here


And some more red lines:

enter image description here

Surprisingly, I have no errors in Unity and the code is actually working:

enter image description here

I also have this annoying yellow icon in VS:

enter image description here

Can you help me in forcing Visual Studio to see System.Data library please?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
227 views
Welcome To Ask or Share your Answers For Others

1 Answer

The System.Data.dll, System.MySql.dll and System.Drawing.dll should all placed in the Assets folder not in the Assets/Plugin folder. Making these changes get ride of the error.

EDIT:

Adding System.Data.dll to the Assets folder should work but is failing silently. Digging deeper into this, I got this error:

The primary reference "System.Data" could not be resolved because it has a higher version "2.0.5.0" than exists in the current target framework. The version found in the current target framework is "2.0.0.0".

So, the System.Data.dll version is different from your target framework and that is the problem. You need another version of System.Data.dll that is the-same version of your target framework(2.0.0.0).

You can get a compatible version(2.0.0.0) from:

C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv3.5ProfileUnity Subset v3.5


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...