解决unity中出现The type or namespace name `MySql' could not be found. Are you missing an assembly referen
unity报错:
错误原因:
Framework target is set to Mono/.NET 3.5, however in Unity 5.5 while loading this dll, the following error appears: "Plugin targets .NET 4.x and is marked as compatible with Editor. Editor can use assemblies targetting .NET 3.5 or lower, please unselect Editor as compatible platform."
Steps to reproduce:
1. Open User's attached project with Unity 5.5 or newer
2. See the Error in the Console
Result: "Serializer" dll fails to load with "Plugin targets .NET 4.x and is marked as compatible with Editor..." message.
Reproduced with: 2017.1.0a3, 5.6.0f1, 5.5.2p2.
Not reproduced with: 5.4.5f1.
Note:
dll loads successfully with Unity 5.4
target framework for each project is set to "Mono/.NET 3.5"
翻译:
框架目标被设置为Mono/。但是在加载这个dll时,在Unity 5中,出现了以下错误:“插件目标。NET 4。x并被标记为与编辑器兼容。编辑器可以使用程序集。NET 3.5或更低,请取消选择编辑器作为兼容的平台。
重现步骤:
1。开放用户附加的项目,有5。5或更新的
2。查看控制台中的错误
结果:“序列化器”dll不能加载“插件目标。NET 4”。x并被标记为与编辑器兼容。“消息。
复制:2017.1.0 a3,5.6.0,5。5.2 p2。
不复制:5.4.5f1。
注意:
dll在Unity 4中成功加载
每个项目的目标框架被设置为“Mono/。NET 3.5”
解决方案:
下载资源(mysql.data.dll和system.data.dll , system.drawing.dll):
https://download.****.net/download/mengchenliuguang/10561119
1.以上三个文件下载后,将其投入到Assets中
拖入后如果出现
请接着按一下操作步骤(原因请看翻译):
大概是unity使用的.net版本和编译器有冲突
2.以下按照次序进行:
选择第二个选项,然后提示重启unity
成功解决该错误