I have something that, I think, will probably be a very simple problem, when developing my first WP7 application, I came to the stage of accessing the site api and parsed the XML, however, I stumble while trying to try using XDocument.
I search and find this sample code: Download the XML file from the website in XDocument (Silverlight and Windows Phone 7) , but the XDocument type does not exist, I understand that it must exist in the System.Xml namespace that I use, but The error still remains, what did I miss?
Development on Visual Studio 2010 Express for Windows Phone, the 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: Error 1 Could not find the name of the type or namespace "XDocument" (do you miss the using directive or assembly reference?)
Thanks in advance
Jay bennett
source share