skip to Main Content

Upgrading from .net5 to .net7 Json Serialization stopped working

We had an ASP.NET Core 5 Web API backend alongside a ReactJS UI app. In startup we instantiated the json framework the following way: services.AddControllers() .AddNewtonsoftJson() .AddJsonOptions(options => { options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); }); It was working well alongside "JsonPropertyName" attributes, i.e.…

VIEW QUESTION

Getting error: Newtonsoft.Json.JsonSerializationException: 'Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'myclass'

I am trying to deserialize a javascript kind of JSON "{n "resultSet1": [n {n "AgentID": 13173,n "FirstName": "Drilon",n "SG_ID": 14336,n "LoginName": "UI813926",n "SG_Description": "LKC Bauhotline",n "SG_Name": "Y_BAU__FO",n "EnterpriseName": "LKC_Abdullahu_Drilon",n "LastName": "Abdullahu"n },n {n "AgentID": 14432,n "FirstName": "Pinar",n "SG_ID": 14336,n "LoginName":…

VIEW QUESTION
Back To Top
Search