Skip to content

SerializerGenerator throws exception when IsRecursive = true and target primitive types #105

@neuecc

Description

@neuecc

New feature of ver 0.6.0 SerializerCodeGenerationConfiguration.IsRecursive is good.
But if target type contains primitive types, throws serialization exception.

var settings = new SerializerCodeGenerationConfiguration
{
    IsRecursive = true,
};
var code = SerializerGenerator.GenerateCode(settings, typeof(int));
System.Runtime.Serialization.SerializationException: Cannot serialize type 'System.Int32' because it does not have any serializable fields nor properties.

My expected result is do nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDetected as bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions