I have a WinJS project that is previously built on Windows 8.1 using VS 2013.
Recently I upgraded this project to Universal Windows 10 by creating a blank Javascrip
Was able to solve this problem in my asp.net mvc project by updating my version of Newton.Json (old Version = 9.0.0.0 to new Version 11.0.0.0) usign Package Manager.
It is possible to solve the problem by updating the 'Newtonsoft' version.
In Visual Studio 2015 it is possible to right click on the "Solution" and select "Manage Nuget packages for solution", search for "Newtonsoft" select a more current version and click update.
I had same issue with the following version 12.0.3:
Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
This issue was only in my Test project (xUnit) and was caused by lack of newtonsoft.json
in this project.
What is important, I was testing code from another project where library was attached and works properly.
I am using Visual Studio 2013 Update 2. In my case, I have a web project and a Web Api project and unit test project and other class libraries in a single solution.
I've spent couple of days to solve the problem. Below is the step-by-step solution that I have found.
Newtonsoft.Json
packs from solution by using below query from Package Manager Console ( to get it View > Other Window > Package Manager Console ).uninstall-package newtonsoft.json -force
Newtonsoft.Json
from Package Manager Consoleinstall-package newtonsoft.json
Newtonsoft.Json
, I have encountered with the following error.The 'Newtonsoft.Json 10.0.3' package requires NuGet client version '2.12' or above, but the current NuGet version i s '2.8.50313.46'
Tools > Extensions and Updates... > In left pane.. select Updates > Visual Studio Gallery.
Update the NuGet Package Manager Extension. Follow the steps that are coming afterwards.
Visual Studio will take a restart after that.
Execute step 6 again.
After Installation packages.config will be added with this below line
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net451" />
After installation web.config will be added with this below lines
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
It will execute successfully, if there is no other error.
I was facing this issue when I added Nuget package Newtonsoft.Json 12.0.0.2 into my two .netstandard library projects and it grabbed almost my full day to solve this issue.
Exception -: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified.
Solution -: I had to remove package from Nuget and went to the following location and followed the next steps -
Step 1. Go to location "C:\Users[UserName].nuget\packages\newtonsoft.json\12.0.2\lib" and here you will get all Nuget versions you installed previously.
Step 2. Since i wanted to use it in my .netstandard 2.0 library project, so i copied "netstandard2.0" folder from this location and paste somewhere my preferred location (**where i generally keep 3rd party dlls).
Step 3. Now i added DLL reference from here to my both project and this way problem solved.
Thanks