XDocument doesn't appear to exist in System.Xml namespace

I'm having what I think will probably be a really simple problem, in developing my first WP7 app I've come to the stage of accessing my Site's api and parsing the XML, however I'm stumbling just at trying to use XDocument.

I search around and found this example code: Load an XML file from a website into XDocument (Silverlight and Windows Phone 7) but the XDocument type does not exist, I understand it is supposed to exist in the System.Xml namespace which I am using, but the error still remains, what have I missed?

Developing on Visual Studio 2010 Express for Windows Phone, code for this class is below:

using System;
using System.Net;
using System.IO;
using System.Xml;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Application
{
    public class DataRetriever
    {
        public void parseNewsXML()
        {
            WebClient client = new WebClient();
            client.OpenReadCompleted += (sender, e) =>
                {
                    if (e.Error != null)
                        return;

                    Stream str = e.Result;
                    XDocument xdoc = XDocument.Load(str);
                };
        }
   } 

Exact error being thrown is: Ошибка 1 Не удалось найти тип или имя пространства имен «XDocument» (отсутствует ли у вас директива using или ссылка на сборку?)

Заранее благодарим

8
задан Community 23 May 2017 в 11:45
поделиться