Skip to content

Deserializer on bot Strategies property throws exception #52

@UrmaGurd

Description

@UrmaGurd

I'm deserializing some Json with a property of list BotStretegies, and in .NET 3.0 onwards it throws an exception due to the change os json serializaer away from Newtonsoft.

The options are to either change BotStrategy to be non-abstract, or possibly add parameterless default constructor.

An exception of type 'System.NotSupportedException' occurred in System.Text.Json.dll but was not handled in user code: 'Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported. Type 'XCommas.Net.Objects.BotStrategy'. Path: $.strategies[0] | LineNumber: 8 | BytePositionInLine: 5.'
 Inner exceptions found, see $exception in variables window for more details.
 Innermost exception 	 System.NotSupportedException : Deserialization of types without a parameterless constructor, a singular parameterized constructor, or a parameterized constructor annotated with 'JsonConstructorAttribute' is not supported. Type 'XCommas.Net.Objects.BotStrategy'.

Here's some more info:
https://stackoverflow.com/questions/70032776/abp-blazor-webassembly-polymorphic-dto-deserialization-using-system-text-json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions