We recently updated a bunch of dlls in our project, including HtmlAgilityPack to their latest versions. This has made the following code which had been working start throwing errors on the first line.
List<HtmlNode> foundNodes = document.QuerySelectorAll(".divider").ToList();
foreach(HtmlNode node in foundNodes){
doWhatever(node);
}
Method not found: 'System.Collections.Generic.IEnumerable`1 HtmlAgilityPack.HtmlNode.Descendants()'.
The last line of the stack trace is:
"at Fizzler.Systems.HtmlAgilityPack.HtmlNodeOps.b__71(HtmlNode n)"
The QuerySelectorAll is returning an IEnumerable of HtmlNode, however I can't seem to be able to cast it to a list anymore. I would hazard a guess there is some related dll with an incompatible version now (fizzler?) missing the Descendants
method? However the NuGet page for HtmlAgilityPack shows no dependencies, and the fizzler version I'm using is 1.0.0 which I think is correct.
It's happening the same error with me after I upgraded the HtmlAgilityPack nuget package.
I resolved downgrading from 1.4.9.4 to 1.4.9 for now.
Let's see the next versions of this package.
Disclaimer: I'm the owner of the project Html Agility Pack
The version 1.5.0 has been released, and this issue has been fixed in the v1.5.0-beta5.
It was caused because a default parameter was added to a method in the v1.4.9.5
Since the library is strongly named, Fizzler could not find anymore this method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With