Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 946
Sharp Always Avatar asked Jan 29 '23 15:01

Sharp Always


1 Answers

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

like image 177
Naucle Avatar answered Feb 02 '23 09:02

Naucle