I am able to use HtmlAgilityPack in a Console Application, but when trying in a WPF app I always get this error on this line document.DocumentNode.Descendants() :
Could not find an implementation of the query pattern for source type 'System.Collections.Generic.IEnumerable<HtmlAgilityPack.HtmlNode>'. 'Where' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'?
This is the code :
public partial class Window1 : Window
{
public Window1()
{
var webget = new HtmlWeb();
var document = webget.Load("http://google.com");
var p = from program in document.DocumentNode.Descendants()
where program.Name == "a"
select program.InnerText;
InitializeComponent();
}
}
Anyone has an idee why I get that error ?
Thanks.
Add:
to your existing using statements near the top of the file.