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.