Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Mono System.Net.XDocument.Load(url) bug workaround?

$
0
0

It appears that XDocument.Load and XDocument.Parse are buggy in Mono. (I just posted Bug 12508 on Bugzilla.) The code below works in Visaul Studio with .NET 4.5, but it doesn't work in Xamarin Studio with Mono / .NET 4.5:

string url = @"http://www.google.com/ig/api?stock=MSFT";
XDocument stockInfoXml = XDocument.Load(url);

After executing this code, stockInfoXml contains: Unknown sig element type: ELEMENT_TYPE_END

I have the same problem if I do this:

WebClient wc = new WebClient();
string stockString = wc.DownloadString (url);
XDocument stockInfoXml = XDocument.Parse (stockString); 

With Mono, it doesn't matter whether I use XDocument or XElement, neither one seems to be able parse the XML in question. But in MS .NET, I am able to parse this XML with either XDocument or XElement.

Does anyone know of a work-around for this problem?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>