0

I'm trying to desarialize a simple json array and bind it a model like this:

JSON

[{
    "id": "311697",
    "km": "36.00",
    "start": "2015-12-07",
    "end": "2015-12-07",
}, {
    "id": "311697",
    "km": "36.00",
    "start": "2015-12-07",
    "end": "2015-12-07",
}]

Model

public class SalModel
    {
        public string id{ get; set; }
        public float km{ get; set; }
        public string start{ get; set; }
        public string end{ get; set; }
    }

And, to get the array I'm using:

var json = new WebClient().DownloadString(url);

At this time, the array is perfectly.

But, any time that I'm trying to use json.net library: with methods like:

var result = JsonConvert.DeserializeObject<List<SalModel>>(json);

I can't debug this method, and I get an error like:

Not is possible load the file or assembly 'Newtonsoft.Json' Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' and any of the dependencies. The assembly's manifest definition does not match the reference to the assembly.

Liam
  • 22,818
  • 25
  • 93
  • 157
MrMins
  • 9,633
  • 10
  • 67
  • 127
  • TL;DR your versions don't match somewhere in your solution. You've prob get a reference in another project to an older version to Netwonsoft.Json – Liam Jan 21 '16 at 15:33
  • @MrMins check out a `GAC` old version is probably cached. also try to reinstall `Newtonsoft` Nuget package – tchelidze Jan 21 '16 at 15:35

0 Answers0