Avatar

Exception when getting list of devices using .dll's

0

When calling api with api.Call<List<Device>>("Get", typeof(Device));  (c#); I am getting an exception as a respose; however, the exception message is the list of devices as json object.  I just started seeing this today.  Please help.

 

Here is the stackTrace with the response, if it helps:

{Geotab.Serialization.JsonSerializerException: Exception of type 'Geotab.Serialization.JsonSerializerException' was thrown. ---> System.ArgumentException: Requested value 'ZenduMaintPro' was not found.
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at Geotab.Reflection.ReflectionHelper.EnumParse(Type type, String enumName)
at Geotab.Serialization.EnumConverter.ReadJsonImpl(JToken token, Type objectType, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Geotab.Checkmate.Serialization.GeotabJsonConverter`1.JObjectToObject(JObject jObject, Type objectType, JsonSerializer serializer)
at Geotab.Checkmate.Serialization.DeviceConverter.ReadJsonImpl(JToken token, Type objectType, JsonSerializer serializer)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)
at Geotab.Serialization.BaseJsonSerializer.DoSerializationActionSafe[T](Func`1 func)
--- End of inner exception stack trace ---
at Geotab.Serialization.BaseJsonSerializer.DoSerializationActionSafe[T](Func`1 func)
at Geotab.Checkmate.Web.WebServerInvoker.TryImportResult(JToken o, Type returnType)}

 

Jose Jara

Please sign in to leave a comment.

15 comments

0
Avatar

Hi Jose,

What version of the nuget package are you using?

Thanks,

Steve

Steve Hansen 0 votes
0
Avatar

Im on ver. 5.7.1705.0; however, this is only happening with one of our clients.  All other clients seem to be working properly.  The client having the issue is Savage Services. Their db name is:

savage_services_midvale

Not sure if that helps you look into it more.  let me know.

Thanks,

Jose

Jose Jara 0 votes
0
Avatar

Good morning Steve, is there an update on this?  I have a client that has a broken integration.  Please let me know.

Thanks,

Jose.

Jose Jara 0 votes
0
Avatar

Hello Jose, 

This might be due to your DLL version being too old. Can you please try the latest version of the Checkmate dll to avoid such issues?

You can find the latest version here.

Regards

Shivansh

Shivansh Singla 0 votes
0
Avatar

Just to clarify, the reason why you need the new dll is because some databases might have some objects that are missing from the old versions of the dll. Due to this, the calls might fail.

It is always recommended to update the DLL to the latest version, whenever available.

Shivansh Singla 0 votes
0
Avatar

Thank you, I tried updating my nuget packet however, I am getting the following error:

Error Could not install package 'Geotab.Checkmate.ObjectModel 5.7.1901'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

thoughts?

Jose Jara 0 votes
0
Avatar

Did support for .net completely end and you are only supporting .netCore? thats a note I see as of 5.7.1711

 

  • .Net SDK samples updated to target netcoreapp2.0

  • .Net nuget package now supports framework: netstandard2.0 (removed support for net46)

Please clarify cause I cannot update to latest dll's.

Jose Jara 0 votes
0
Avatar

They still support net47, so your app needs to target .NET Framework 4.7 or greater.

Ben Virkler 0 votes
0
Avatar

I've updated my framework to 4.7.2 and I am still getting the same error about my project targeting 4.7.2 and the package not containing any assembly references compatible with that framework. 


Error Could not install package 'Geotab.Checkmate.ObjectModel 5.7.1711'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.7.2', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Help please.

Jose

Jose Jara 0 votes
0
Avatar

Jose,

The last error shows a  5.7.1711 DLL which is still quite old. I would advise you to try the 5.7.1804 DLL as that will more than likely match the version of your database.

Mauricio Muniz 0 votes
0
Avatar

Hi Jose,

As of version ## of the Geotab.Checkmate.ObjectModel nuget package it supports .netstandard2.0. This is compatible with .Net 4.6.1+, as is shown in this documentation. However, Microsoft has started recommending .Net 4.7.2+ for ease of compatibility. We test our package releases against 4.6.1+ and it does work in our tests.

Try manually editing the .csproj file to add the latest version. In the past VS has blocked me for unknown reason but when I updated it manually it has worked without issue for me.

<PackageReference Include="Geotab.Checkmate.ObjectModel" Version="5.7.1901" />
Steve Hansen 0 votes
0
Avatar

Ok, so I was finally able to update the dll; however, now that I am trying to run my integration it is telling me that theres a method/ctor not found:

 

Method not found: 'Void Geotab.Checkmate.API..ctor(System.String, System.String, System.String, System.String, System.String, Int32, System.Net.Http.HttpMessageHandler).

Help?

Jose Jara 0 votes
0
Avatar

Good morning guys, any update on my last question?

After my update to the latest GeoTab nuget packet, I am getting the "Method not found Api..ctor".  Here is how I am using it and according to the library the ctor is being used properly.

 

api = new API(UserName, Password, null, DatabaseName, "my.geotab.com");

help?

Jose

Jose Jara 0 votes
0
Avatar

I haven't seen that before. Have you tried manually entering values for optional parameters?

Something like:

api = new API(UserName, Password, null, DatabaseName, "my.geotab.com", (int)TimeSpan.FromMinutes(3).TotalMilliseconds, null);

or maybe try to leave out server (defaults to "my.geotab.com")?

api = new API(UserName, Password, null, DatabaseName);

 

Steve Hansen 0 votes