![](/uploads/1/2/7/5/127563340/374943748.jpg)
Hi,Unfortunately, this code will not be sufficient to isolate why is this exception thrown. Hopefully, the message of the exception appears to be quite informative. The exception is thrown at the time of deserialization from JSON string to.NET objects.
![Timespan Timespan](/uploads/1/2/7/5/127563340/776037233.png)
Working around the Json Serializer in RestSharp's RestClient I had issues is my tests when using RestSharp's RestClient to send Json. One of my models contains a TimeSpan. I would say JSON this the most popular way to do serialization due to it being less verbose than XMLand therefore can be more performant. Before.NET Core and even before NuGet, the most widely used library to serialize JSON is Newtonsoft.Jsonwith over 266 million downloads to date!
It is thrown by the Newtonsoft.JSON lib used by Everlive for JSON serialization.The block that retrieves the data looks pretty much valid. Could you please verify the mapping between the content type and the.NET model class? Probably the mapping is forcing some JSON fields to deserializing but they does not exist.
Are you casting the fetched timesheets (IEnumerable) to another type?Could you please provide some screenshots of several JSON objects before deserializing and the.NET model?Regards,Anton DobrevTelerik. Hello Sulu,We have tried to reproduce the error in various ways but to no avail. Please, find attached a simple console app that we used for testing (currently is it is stripped down only to the code you have provided). Probably you would not mind to commit to the project continuously the missing parts until the problem can be reproduced and return it to us?The API key for the backend app is not included in the project, you need to enter it manually in order to test it.One thing we have noticed is that there are items whose 'IsOnClock' field is set to a boolean, and others have this field set to an integer.
Though it is unlikely the cause, you may consider adding some consistency to all values, as this may impact the filtering on this field.Regards,Anton DobrevTelerik. I'm seeing the same exact Aggregation exception in trying the console app.
(FYI, I pasted in our API key to the noted place in the Program.cs). Hello Sulu,We are sorry to hear that you are still experiencing these issues.This last function worked seamlessly with us.Actually, we managed to reproduce the 'Additional text.' Exception by installing the latest JSON.NET assembly from NuGet. After the installation, the exception was thrown at the moment of fetching the items from the backend. Trying to get the count worked though.
Uninstalling the JSON assembly package via the NuGet PM and reverting back to the version included with the.NET SDK worked again.Could you please verify if there is no other JSON assembly loaded, for example, from some controls or frameworks that you are using that can cause some compatibility issues? Do you have the chance to run the console app at another workstation? Also, I have noticed some similar posts by you in the Telerik Forums, did you manage to solve the issues back then?Please, keep us posted with the results.Regards,Anton DobrevTelerik. Well, I perhaps jumped to conclusions.
(I am so impulsive!) Anyways, the link to the Stack Overflow article is correct. My manager took a look at my code and warned me that I could be masking the underlying issue. So, I'm taking a second look at the Timesheet table and how we interpret the fields. So here's the summary of what I've found so far:(1) If I restrict the number of records returned, I don't see the exception.(2) I need to go over the fields in the table one more time and make sure that I've mapped over to.NET fields in the class correctly.(3) And, since I do have a way to reproduce it, (by getting more days' worth of data), I can try debugging down into my application. Since the AggregationException points to multiple errors, I'll just have to go over it more detail and more carefully.You mentioned that the correct Netwonsoft.Json.dll should come from the.NET SDK build. I'll go look for that.
The latest one I have was from CodePlex. I suspect I still have the wrong one.So that is where I'm at. (Thanks for the points!) -sulu. Hi Sulu,The only way to upload a project so that it remains private would be to submit a support ticket. This option depends on your license.Alternatively, I can suggest that you prepare a basic project that illustrates the issue and post it here without including the API key for the backend project.In addition, we are planning to introduce a custom build of the.NET SDKs with the Newtonsoft.JSON.dll included internally.
![Json Json](/uploads/1/2/7/5/127563340/511365096.png)
With this build we aim to protect our customers from such issues with referenced other incompatible versions of the Newtonsoft.JSON library.In this case, the developers will need to reference only the dll of the Backend Services.NET SDK for working with Backend Services. At the same time they can continue to use the other Newtonsoft.JSON version where needed throughout the same project.Please, find attached a unofficial, beta version of this build. The official version will be available from the Downloads section of the Telerik Platform portal.Please, keep us posted with your progress.Regards,Anton DobrevTelerik. Hello Sulu,Yes please, do not hesitate to contact us if any issues or technical questions occur.Further, we have now officially integrated the Newtonsoft.Json library in our.NET SDK.
The latest build can be downloaded from the Downloads Backend Services.NET or Windows Phone sections in your Telerik Platform account.With this integration you no longer need to reference Newtonsoft.Json.dll in your projects when you use the Telerik Backend Services.NET SDK distributions.If you are using the Newtonsoft.Json library in your project outside the scope of Backend Services, you can use whatever version fits your project, it will not conflict with the internal version in the Backend Services SDK.Please, let us know if this works for you.Regards,Anton DobrevTelerik.
![](/uploads/1/2/7/5/127563340/374943748.jpg)