Unexpected character encountered while parsing value

Possibly you are not passing JSON to DeserializeObject. It looks like from File.WriteAllText(tmpfile,… that type of tmpfile is string that contain path to a file. JsonConvert.DeserializeObject takes JSON value, not file path – so it fails trying to convert something like @”c:\temp\fooo” – which is clearly not JSON.

JSON.NET Error Self referencing loop detected for type

That was the best solution https://docs.microsoft.com/en-us/archive/blogs/hongyes/loop-reference-handling-in-web-api Fix 1: Ignoring circular reference globally (I have chosen/tried this one, as have many others) The json.net serializer has an option to ignore circular references. Put the following code in WebApiConfig.cs file: The simple fix will make serializer to ignore the reference which will cause a loop. However, it … Read more

Parse Json string in C#

I’m using Json.net in my project and it works great. In you case, you can do this to parse your json: EDIT: I changed the code so it supports reading your json file (array) Code to parse: Output: BTW, you can use LinqPad to test your code, easier than creating a solution or project in … 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 It also did not work