14

I just downloaded the trial version of "Mono for Android"/MonoDevelop 3.1.1 for Mac OS X. I am trying to parse some XML using XDocument. But I can't seem to find the import I need:

using System.Xml.Linq;

I get the following error:

The type or namespace name 'Linq' does not exist in the namespace 'System.xml'. Are you missing an assembly reference?

Opening System.Xml reference under References in Solution Explorer shows that there are no Linq in it:

System.Xml
 - References
   - mscorlib
   - System
 - System.Xml
 - System.Xml.Schema
 - System.Xml.Serialization
 - System.Xml.XPath
 - System.Xml.Xsl

Any ideas?

Edit: More info:

  • Runtime: Mono 2.10.9 (tarball)

  • Mono for Android: 4.4.55 (Evaluation)

  • Monotouch: Xamarin.Mac: Not Installed

  • Operating System: Mac OS X 10.8.2

System.Xml:

  • [assembly: AssemblyVersion ("2.0.5.0")]
4

2 回答 2

22

You need to add the System.Xml.Linq assembly to your project references; the System.Xml.Linq isn't in System.Xml, but has an assembly of itself.

Right click References in your solution window, and select Edit References. Add System.Xml.Linq there.

enter image description here

于 2013-02-14T16:08:42.467 回答
0

on the commandline

mcs /reference:System.Xml.Linq.dll ...

works for me

于 2017-10-30T10:56:19.623 回答