1

Why Nuget producing an error when I install a package after Newtonsoft.Json v11.0.2 is installed. Whenever I try to install another package I get the following error

Install-Package : An error occurred while retrieving package metadata for 'Newtonsoft.Json.11.0.2' 
from source 'C:\Users\yusuf\Documents\Visual Studio 2015\Projects\Eman\packages'.
At line:1 char:1
+ Install-Package MaterialDesignThemes
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets. 
   InstallPackageCommand

Whenever i remove the line with the Newtonsoft.json package defined in packages.config the package installs successfully. Is it something wrong with json package itself or is it my package manager that's messed up, anyway can someone show me how i can fix this.

P.S. This happens with whichever package i try to install while json package is already installed.

EDIT I tried deleting the package line in packages.config and also deleting the downloaded package files and reinstalled the package several times, i keep getting the same problem

lulliezy
  • 1,741
  • 5
  • 24
  • 49

1 Answers1

1

First, downgrade Newtonsoft.Json v11.0.2 to Newtonsoft.Json v6.0.4. Second, install another nuget package.

If the package successfully installs, upgrade Newtonsoft.Json v6.0.4 back to Newtonsoft.Json v11.0.2.

Robert Columbia
  • 6,313
  • 15
  • 32
  • 40
Amit Dudhat
  • 116
  • 4