EPPlus:"Column out of range" LoadFromCollection 错误

EPPlus: "Column out of range" error with LoadFromCollection

我收到 LoadFromCollection 的 "Column out of range" 错误 - 代码如下。插入EPPlus自带的SampleApp进行复制。

我是不是做错了什么或者是一个错误?或者我没有设置的配置设置?

public class tst
    {
        public string Name;
        [Description("Created Time")]
        public DateTime Created_time;
    }


     var pck = new ExcelPackage();

            var kpcollection = new List<tst>();
            for (var i = 1; i <= 10; i++)
            {
                kpcollection.Add(new tst
                {
                    Name = "line" + i.ToString(),
                    Created_time = DateTime.Now
                });
            }

            var wsenum = pck.Workbook.Worksheets.Add("KPTest");
            //Load the collection starting from cell A1...
            wsenum.Cells["A1"].LoadFromCollection(kpcollection, true, TableStyles.Medium9);

这是 EPPlus 库中的错误 has been reported on September 25, 2017

为每个变量添加像 { get; set;} 这样的属性,因为 epplus 的工作方式是基于 class.

的属性

例如,而不是使用:

class student
{
    int num;
   string name;
}

使用这个:

class student
{
     int num { get; set; }
     string name { get; set; }
}