问题描述
我正在尝试在Windows 7
上的Unity3D
项目内使用XDocument
类.
I'm trying to use XDocument
class inside a Unity3D
project on Windows 7
.
我做了以下事情:
- 将参考
System.Xml.Linq
添加到了Mono项目. -
包括名称空间:
- added the reference
System.Xml.Linq
to the Mono project. included the namespace:
using System.Xml.Linq;
Mono/.NET 3.5
Mono/.NET 3.5
但仍然Unity3D
对此有所抱怨.这是控制台中的错误输出:
But still Unity3D
complains about it. Here's the error output in the console:
有什么主意吗?
推荐答案
已对此进行了讨论 很多 时间 之前,unity3d.com/questions/46039/can-not-reference-systemxmllinq.html"rel =" nofollow noreferrer>,但是这些答案很少.
This has been discussed many times before, but few of these answers are complete.
如前所述,Unity3d最多仅支持.NET 2.0版,并且System.Xml.Linq似乎是在.NET 3.5中引入的,除了它没有在 Unity3d兼容性列表随处可见.
As has been said before, Unity3d only supports up to .NET version 2.0, and it seems System.Xml.Linq was introduced in .NET 3.5, besides the fact that it is not listed on the Unity3d compatibility list anywhere.
另一种可能的解决方案是将DLL自己添加到Unity编辑器中,如下所示:
Another possible solution is to add the DLL yourself into the Unity Editor as shown:
如果这些都不为您带来好运,那么恐怕您不走运.
If none of these yield ANY luck for you, then I'm afraid you are out of luck.
这篇关于如何在Mono中使用XDocument类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!