Unity3d and System.Xml.Linq

对着背影说爱祢 提交于 2019-12-11 03:19:01

问题


So even though the Unity\Editor\Data\Mono\lib\mono\2.0\System.Xml.Linq.dll file exists, doing:

using System.Xml.Linq;

generates the following error: "The type or namespace name 'Linq' does not exist in the namespace 'System.Xml'.

What can I do to implement this?


回答1:


You also need to reference the Namespace by right clicking References and selecting the namespace.




回答2:


I know this post is a little old but I thought this may perhaps help someone coming across this post.

If you want to add a third party dll to a project in unity, the best method is usually to add it to the \Assets\Plugins folder, and it'll be included automatically as a reference in your -csharp.sln file. Adding libraries this way ensures you overcome compile order issues when dealing with UnityScript, and ensures that copies of your projects come with their dependencies.

The "Plugins" folder is where you must put any native plugins, which you want to be accessible by your scripts. They will also be automatically included in your build. In Windows, native plugins exist as .dll files, in Mac OS X, they are .bundle files, and in Linux, they are .so files. Like the Standard Assets folder, any scripts in here are compiled earlier, allowing them to be accessed by other scripts (of any language) that are outside the Plugins folder. - http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder



来源:https://stackoverflow.com/questions/4912432/unity3d-and-system-xml-linq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!