Can I use HTML Agility Pack in Windows Forms Applications?

c# html-agility-pack winforms

Question

This is my first time doing my work with HAP, but I find a problem with HtmlDocument class, I can't use it, because intellisense tells me that it is ambiguous reference, this is the picture : enter image description here

I have imported the library needed it this code which are using HTML_Agility; using HtmlAgilityPack; and I also add reference to its DLL file but it can't help me so much. Do you know why this happens and how to fix it?

1
2
11/4/2012 1:49:33 PM

Accepted Answer

To avoid the ambiguous reference write like this:

HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
2
11/4/2012 1:40:00 PM

Popular Answer

There's also exists a System.Windows.Forms.HtmlDocument class.

Try explicitly qualifying your classname instead of using a using statement, or rename the class with a using statement such as using HAPDocument = HtmlAgilityPack.HtmlDocument; (and then use HAPDocument instead of HtmlDocument in your source code).



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow