I have visual studio 2015 community edition and I am trying to use the NuGet package manger to install HTML Agility Pack into my project.
Firstly, the search wasn't working and I could not install it via command line also. So, I uninstalled the extension and re-installed it and still doesn't work.
Here's the screenshot of search not working and command line install failure:
PM> Install-Package HtmlAgilityPack
Install-Package : Object reference not set to an instance of an object.
At line:1 char:1
+ Install-Package HtmlAgilityPack
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Any idea how to fix this?
Fix :
Close your Visual Studio.
Navigate to %AppData%\NuGet\ folder
Delete the NuGet.config file
Now open Visual Studio. You can notice that a new NuGet.Config file is generated
Issue will be fixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With