11

Why can't I use htmlagilitypack with windows phone 8? I appears to be supported on all platforms including Win8 Win8RT and WP7/WP7.5 and Silverlight 5. Is there one of the DLLS that would work?

What else can I use to Parse HTML in WP8? All suggestions are for the htmlagilitypack.

user854534
  • 111
  • 1
  • 3
  • Anthony has given you a correct and usable answer. I can personally attest to this as I had the problem you describe and his suggestion worked immediately. It would be good manners to mark it as accepted, and doing so will increase the chances that someone will bother to respond the next time you ask for help. – Peter Wone Dec 18 '13 at 10:55

6 Answers6

17

The issue appears to be that the NuGet package references the incorrect assembly for WP8.

By default it seems that it references the binary in sl4-windowsphone71, manually removing the reference to the HtmlAgilityPack DLL and referencing the binary in the sl3-wp folder removes the dependency problem.

That is how I have resolved it anyway.

Anthony
  • 2,240
  • 4
  • 20
  • 24
3

As anthony mentioned, just replace the reference from sl4-windowsphone71 to sl3-wp and it will work.

sunder
  • 1,803
  • 4
  • 29
  • 50
2

It seems that Windows Phone 8 doesn't like the System.Xml.XPath.dll from the Silverlight SDK. My app that works fine on Windows Phone 7.5, won't work on WP 8. I am currently researching for another alternative for HTML Agility Pack.

Timotei
  • 1,909
  • 2
  • 22
  • 31
1

You probalby can and you've either forgot to unblock the web downloaded DLLs or forgot to update your NuGet package manager. Let me know if that isn't the case.

Community
  • 1
  • 1
JustinAngel
  • 16,082
  • 3
  • 44
  • 73
  • 1
    I am also having an issue with this, however the original poster didn't provide very much information. The error I am getting when trying to use HtmlAgilityPack on WP8 is related to a System.Xml reference, the exact error is `The type 'System.Xml.XPath.IXPathNavigable' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml.XPath, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'`. – Anthony Jan 09 '13 at 08:06
1

The portable class library version of htmlagilitypack:

https://github.com/Deathspike/HtmlAgilityPack-PCL

it is out on nuget!

JP Hellemons
  • 5,977
  • 11
  • 63
  • 128
0

In my lib folder, sl3-wp folder is empty.

I fixed by downloading HtmlAgilityPack-PCL from NuGet Manager