Epplus 8+ 许可证设置
Epplus 8+ 之后非商业许可证的设置变了如果还用普通的方法会报错
Unhandled exception. OfficeOpenXml.LicenseContextPropertyObsoleteException: Please use the static ‘ExcelPackage.License’ property to set the required license information from EPPlus 8 and later versions. For more info see http://epplussoftware.com/developers/licensenotsetexception.
at OfficeOpenXml.ExcelPackage.set_LicenseContext(Nullable`1 value)
at Program.$(String[] args) in D:\Study\Rider\WorkSpace\Test\GetFieldNoSame\Program.cs:line 52
这个时候需要使用
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization");//组织
//或者
ExcelPackage.License.SetNonCommercialPersonal("My Name");//个人
括号里的字符串可以随意填
下面是官方网站给出的代码,上面是组织下面是个人。都是非商业的许可。