Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet Package Manager not searching or installing on VS2015 - Object reference not set to an instance of an object

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:

enter image description here

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?

like image 502
Latheesan Avatar asked Dec 04 '15 10:12

Latheesan


1 Answers

Fix :

  1. Close your Visual Studio.

  2. Navigate to %AppData%\NuGet\ folder

  3. Delete the NuGet.config file

  4. Now open Visual Studio. You can notice that a new NuGet.Config file is generated

Issue will be fixed.

like image 105
piyush gakre Avatar answered Sep 24 '22 18:09

piyush gakre