简体   繁体   中英

Cant install HtmlAgilityPack on VS2012

I can not install the HtmlAgilityPack by nuget ... I already uninstalled and reinserted the nuget, I changed the .NET version and still the same error

Install-Package : 'HtmlAgilityPack' already has a dependency defined for 'System.Net.Http'.
At line:1 char:16
+ Install-Package <<<<  HtmlAgilityPack -Version 1.5.1
    + CategoryInfo          : NotSpecified: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPa 
   ckageCommand

This is because, to my understanding, the latest version of 'System.Net.Http' is not compatible with the latest version of Nuget that you can get on VS2012 (which is Nuget 2.8, same applies to VS2010). So, you have two options here :

  • Option 1

Install the latest version of Visual Studio where you'll get the latest version of Nuget and you won't have this problem anymore.

  • Option 2

Instead of picking the lastest version of the package 'HtmlAgilityPack', just get the last version that works with VS2012/2010, which is 1.4.9.5. Which means that you'll be using :

PM> Install-Package HtmlAgilityPack -Version 1.4.9.5

nuget deleted this verson of HtmlAgilityPack ;

you can Download from this link https://www.dll-files.com/htmlagilitypack.dll.html

but this canot support GetElementsByTagName :\\

Download the latest version and refer the dll from packages. It works. No dependency issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM