SharpSerializer icon indicating copy to clipboard operation
SharpSerializer copied to clipboard

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

Open anggalol opened this issue 5 years ago • 2 comments

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)

anggalol avatar Aug 30 '20 10:08 anggalol

As the previous answer, I use the version 2.20.0 and fix the issues.

anggalol avatar Aug 30 '20 10:08 anggalol

Please fix this bug. It's been opened already three years. How you can release a new version with this trivial bug, is this a serious project?

zszabo79 avatar Feb 01 '24 06:02 zszabo79