问题
I have downloaded the HTML Agility pack but I don't know which one should I import .There are lots of folders and I don't know which one to import dll . Folders:
Net20
Net40
net40-client
Net45
sl3-wp
sl4
sl4-windowsphone71
sl5
winrt45
I tried importing winrt45 but am getting error when I use doc.DocumentElement.SelectNodes (There is no reference ) I have tried
using HtmlAgilityPack.HtmlDocument;
using HtmlAgilityPack;
but doesn't work
回答1:
The correct assembly to reference strongly depends on your target framework.
This release includes versions of Html Agility Pack for .NET 2.0 - 4.5, Silverlight 4-5, Windows Phone 7-7.1 and Windows 8 Metro.
(Source: http://htmlagilitypack.codeplex.com/releases/view/90925)
According to the quote above:
Directory | Framework
----------------------+-------------------------------------------
Net20 | .NET 2.0
Net40 | .NET 4.0
net40-client | .NET 4.0 Client Profile
Net45 | .NET 4.5
sl3-wp | Silverlight 3
sl4 | Silverlight 4
sl4-windowsphone71 | Silverlight 4 used by Windows Phone 7.1+
sl5 | Silverlight 5
winrt45 | Windows RT
NuGet
The preferred method of referencing HtmlAgilityPack is through nuget:
http://nuget.org/packages/HtmlAgilityPack
来源:https://stackoverflow.com/questions/20647621/html-agility-pack-dll