Forum General
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

workaround for Mono bug 523151

tdufourtdufour CAMember
edited March 2014 in General

Hi,

I am trying to do a webrequest and to get the response into a xmlReader. But, always my xmlreader throw a nullReference exception when I call : xmlreader.MoveToContent() . I verified the response received from my webrequest and it's ok: the response seems to have a content and the status of my response is "OK". I also verified the xmlReader content and it seems to have nothing!

There is my code :
var request = WebRequest.Create (MyUri); using (var response = request.GetResponse ()) { using (var stream = response.GetResponseStream ()) { using (var reader = XmlReader.Create (stream)) { // FIXME this is a workaround for Mono bug 523151 xmlreader.MoveToContent (); } } }

I spent so much time on this problem without finding a solution! So if anybody can help me, i would appreciate it a lot!

Thanks!

Posts

  • JasonAwbreyJasonAwbrey USInsider, University, Developer Group Leader mod

    Have you tried the XML classes in LINQ instead? I find them a lot easier to work with than the older System.XML ones.

  • tdufourtdufour CAMember

    Unfortunately, I can't use linq! I use a framework that requires a xmlreader to work and do the job I Want. I don't have any other choice! Thanks!

Sign In or Register to comment.