Could not load file or assembly ‘Newtonsoft.Json’ or one of its dependencies. Manifest definition does not match the assembly reference

Things I’ve tried after searching: in Web.Config put a binding on the old version: <dependentAssembly> <assemblyIdentity name=”Newtonsoft.Json” publicKeyToken=”30ad4fe6b2a6aeed” culture=”neutral” /> <bindingRedirect oldVersion=”0.0.0.0-6.0.0.0″ newVersion=”6.0.1.0″ /> </dependentAssembly> Edit my .csproj file to make sure there is only one Newtonsoft reference <Reference Include=”Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL”> <HintPath>..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll</HintPath> <SpecificVersion>False</SpecificVersion> <Private>True</Private> </Reference> Search my computer for every Newtonsoft.Json.dll and … Read more

Could not load file or assembly ‘Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’

I am getting the Error System.IO.FileLoadException : Could not load file or assembly ‘Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) for my CI build Solution which I tried <dependentAssembly> <assemblyIdentity name=”Newtonsoft.Json” publicKeyToken=”30ad4fe6b2a6aeed” culture=”neutral” /> <bindingRedirect oldVersion=”0.0.0.0-6.0.0.0″ newVersion=”6.0.0.0″ /> … Read more

How can I return camelCase JSON serialized by JSON.NET from ASP.NET MVC controller methods?

My problem is that I wish to return camelCased (as opposed to the standard PascalCase) JSON data via ActionResults from ASP.NET MVC controller methods, serialized by JSON.NET. As an example consider the following C# class: public class Person { public string FirstName { get; set; } public string LastName { get; set; } } By … Read more

Convert Newtonsoft.Json.Linq.JArray to a list of specific object type

I have the following variable of type {Newtonsoft.Json.Linq.JArray}. properties[“Value”] {[ { “Name”: “Username”, “Selected”: true }, { “Name”: “Password”, “Selected”: true } ]} What I want to accomplish is to convert this to List<SelectableEnumItem> where SelectableEnumItem is the following type: public class SelectableEnumItem { public string Name { get; set; } public bool Selected { … Read more

How to deserialize a JObject to .NET object

I happily use the Newtonsoft JSON library. For example, I would create a JObject from a .NET object, in this case an instance of Exception (might or might not be a subclass) if (result is Exception) var jobjectInstance = JObject.FromObject(result); now I know the library can deserialize JSON text (i.e. a string) to an object … Read more

How to implement custom JsonConverter in JSON.NET?

I am trying to extend the JSON.net example given here http://james.newtonking.com/projects/json/help/CustomCreationConverter.html I have another sub class deriving from base class/Interface public class Person { public string FirstName { get; set; } public string LastName { get; set; } } public class Employee : Person { public string Department { get; set; } public string JobTitle … Read more