私はコンソールアプリケーションでHtmlAgilityPackを使用することですが、WPFアプリケーションにしようとしたとき、私はいつもこのラインdocument.DocumentNode.Descendants()
でこのエラーを取得するために働いていない:がHtmlAgilityPack私のWPFプロジェクト
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'?
これはコードです:
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();
}
}
なぜ誰かが私にそのエラーが表示されますか?
ありがとうございました。
しかし、そのソースファイルに 'using System.Linq'がありますか? – ordag
ダムそれ、私はそんなに、答えとして投稿してください、私は受け入れ、感謝します。 – Kobe