MonoDevelop 3.1.1 can't find System.Xml.Linq

Sunkas picture Sunkas · Feb 14, 2013 · Viewed 9.6k times · Source

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

Answer

antonijn picture antonijn · Feb 14, 2013

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