Skip to content

Fails to deserialise when type is a record #2

@YarekTyshchenko

Description

@YarekTyshchenko
public record Config(
    string test);
var options = new JsonSerializerOptions()
    .SetMissingMemberHandling(MissingMemberHandling.Error);
JsonSerializer.Deserialize<Config>("{\"test\":\"test\"}", options);
Unhandled exception. System.MissingMethodException: Cannot dynamically create an instance of type 'TestProject.Config'. Reason: No parameterless constructor defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions