How do we fix the serialization error.
Upgraded Hangfire.Console.Extensions version from v1.0.5 to v2.0.0; now we cannot view details of previous jobs with logs prior to v2.0.0. Hangfire is throwing error 500 with the message below.
An unhandled exception was thrown by the application.
Newtonsoft.Json.JsonSerializationException: Error resolving type specified in JSON 'Hangfire.Console.Serialization.ConsoleLine, Hangfire.Console'. Path '$type', line 1, position 71.
Based on my investigation, jobs created prior v2.0.0 has “$type” as part of the data process logs.
This is what existing data member stored in redis looks like. (No issue accessing the data in hangfire before upgrading)
{
"$type": "Hangfire.Console.Serialization.ConsoleLine, Hangfire.Console",
"t": 0.027,
"s": "info: Executing...",
"c": "#ffffff"
}
New data after v2.0.0
{
"t": 0.016,
"s": "info: Executing...",
"c": "#ffffff"
}