Skip to content

Object reference not set to an instance of an object (XmlSerializer) - Version 3.0.1 #13

@anggalol

Description

@anggalol

I try to reproduce this exception, and found that the array is the problem. Here what cause the problem.

public class Program
{
    public static void Main()
    {
        Test t = new Test();
        t.ASD = new[] { "asdf", "afff" };

        SharpSerializer ss = new SharpSerializer();
        FileStream fs = new FileStream("D:\\KsdK.txt", FileMode.Create);
        ss.Serialize(t, fs);
    }

    public class Test
    {
        public string[] ASD { get; set; }
    }
}

The ss.Serialize(t, fs) throw NullReferenceException at Polenter.Serialization.Core.ArrayAnalyzer.getLength(Int32 dimension, Type arrayType)

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