HtmlAgilityPack works in WP8 but not WP7?
I have used HTMLAgilityPack in a Windows Phone application. I want the
application to be available both for Windows Phone 8, but lower versions
of windows as well.
My syntax in the callback method of LoadAsync() is like this:
HtmlDocument doc = e.Document;
var collection = (from data in doc.DocumentNode.Descendants()
where data.name=="a" && data.InnerText.Contains(myString)
select new
{ Link = data.Attributes["href"].Value }).First();
Now, this code runs perfectly in Windows 8 emulator, but in older versions
(such as in the emulator 7.1) I get a nullreference exception. It is
really weird, as the same thing, works in WP8, but in 7.1 it just crashes.
I tested it on a friend's phone, running 7.8, and it didn't crash, yet it
didn't display the results as the WP8 emulator does.
I have read about incompatibility from WP7.1 to WP8, but not vice versa. I
have however, included the XPath.dll from the silverlight 4.0 folder in my
references.
Any clue? Is it possible that is due to my LINQ statement?
No comments:
Post a Comment