4

I'm using Visual Studio(VS) 2010 Ultimate (with .NET 4.0) to install Json.NET (10.0.2) but get failed with error message:

'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp'

I've tried to search solution for this and tried many ways like: update NuGet Package. but unfortunately, it didn't work. What is to be done?

More tried update:

  • The version of NuGet Package: 2.8.60318.667
  • Install Json.net version: 9.0.1 without problem
RBT
  • 24,161
  • 21
  • 159
  • 240
binh
  • 51
  • 1
  • 7

2 Answers2

1

I tried this solution and it worked for me:

  • Tool -> NuGet Packages Manager - Manage Nuget Package for Solution

  • Select Online tab and search online for Nuget.CommandLine -> install it

  • After installing, you can find nuget.exe in your Current Project folder -> Packages -> NuGet.CommandlineXXX
  • Run CMD and use command install to install latest version of Json.NET
  • Back to Project -> add reference - Browse for DLL file

Done!

RBT
  • 24,161
  • 21
  • 159
  • 240
binh
  • 51
  • 1
  • 7
0

Please check the version of .NET Framework you are using. There are chances that previous frameworks such as v3.5 or below doesn't support latest version of JSON.

Or this would help you : NuGet: 'X' already has a dependency defined for 'Y'

RBT
  • 24,161
  • 21
  • 159
  • 240
Kingsman
  • 174
  • 1
  • 10
  • Which version of NuGet are you using? Here are steps to check : https://learn.microsoft.com/en-us/nuget/policies/nuget-faq#nuget-in-visual-studio – Kingsman Apr 19 '17 at 06:47
  • Name : Package Manager Host Version : 2.8.60318.667 InstanceId : 3d141890-c5fa-4574-b12d-5f874451178b UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : en-US CurrentUICulture : en-US PrivateData : NuGetConsole.Host.PowerShell.Implementation.NuGetPSHost+Commander DebuggerEnabled : True IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace – binh Apr 19 '17 at 07:03
  • My buddy was facing same problem, please try uninstalling current JSON version and reinstall updated version. It worked for him. *Please make sure you do this for a separate dummy project first, if it works then try it for your project. – Kingsman Apr 19 '17 at 09:09
  • I did uninstall old version and install latest one but no luck – binh Apr 20 '17 at 10:14
  • I am out of options mate ! – Kingsman Apr 20 '17 at 10:25