C# – MonoDevelop 3.1.1 can’t find System.Xml.Linq

clinqmonomonodevelopxamarin.mobile

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")]

Best Answer

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

Related Topic