Exception when fetching track data

NOTE: this feature has been deprecated and we do not recommend its use. For more information, please refer to the deprecation schedule.

SYMPTOM

You get this exception in the ErrorLog when fetching track data using SOAP:

HttpCall failed: http://localhost:8090/api/messageStore/list/2716206 | System.TypeInitializationException: The type initializer for 'GpsGate.Online.Message.v7.DAO.GateMessageReaderDAOV7' threw an exception. ---> System.TypeInitializationException: The type initializer for 'com.gpsgate.avro.messages.GateMessageData' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.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)
   at Avro.Schema.Parse(String json, SchemaNames names, String encspace)
   at com.gpsgate.avro.messages.GateMessageData..cctor()
   --- End of inner exception stack trace ---
   at GpsGate.Online.Message.v7.DAO.GateMessageReaderDAOV7..cctor()
   --- End of inner exception stack trace ---
   at GpsGate.Online.Message.v7.DAO.GateMessageReaderDAOV7.d__10.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Franson.Web.Http.HttpRequestHelper._Get[T](String endpoints, String path, HttpStatusCode& statusCode, Dictionary`2 headers, Int32 endpointTimeoutMs, Func`3 responseHandler)

 

SOLUTION

The best long-term solution is to switch to using REST instead.

Until you have switched to REST, please edit web.config which you find under C:\GpsGateServer\IIS. And add the following inside the <configuration> tag.

 
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="10.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>