Unity installation is giving error

1

I installed Unity for DI and by NuGet is giving an error, which I do not understand, it seems to me that it points to NewtonSoft, see the error below:

  

Install-Package: An error occurred while retrieving package metadata   for 'Newtonsoft.Json.10.0.2' from source   'C: \ Sites \ my_webapi \ packages'. At line: 1 char: 1   + Install-Package Unity   + ~~~~~~~~~~~~~~~~~~~~~       + CategoryInfo: NotSpecified: (:) [Install-Package], Exception       + FullyQualifiedErrorId: NuGetCmdletUnhandledException, NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

I tried to remove it like this: PM> Unistall-Package Newtonsoft.Json RemoveDependencies and gives an error similar to above, but with this message:

  

'RemoveDependencies' is not found.

    
asked by anonymous 24.05.2017 / 15:52

2 answers

1

I recently had the same problem with Newtonsoft. I was able to resolve updating.

Update-Package Newtonsoft.Json
    
24.05.2017 / 16:14
0

This error is not related to Unity, exactly. For some reason, your Visual Studio was unable to connect to NuGet.

Try running the following command before attempting to install Unity again in the Package Manager Console:

PM> Update-Package

I do not think it's a good idea to remove JSON.NET, but in any case, the correct command is:

PM> Unistall-Package Newtonsoft.Json -RemoveDependencies
    
24.05.2017 / 16:08