The latest version of EPPlus 5 has changed their license type.
I have searched their website and it shows to use it for a non-commercial application it is 'easiest' to register the environment variable.
However their examples are either C or web-based and I have not figured out how to do this on the VB code in VS2019, especially at the "User Level" as it says at the bottom.
Has anyone done this, and is there anything else different from the previous version (last version I used was v3)
Here is a copy from the website:
LicenseContext parameter must be set
With the license change EPPlus has a new parameter that needs to be configured. If the LicenseContext is not set, EPPlus will throw a LicenseException (only in debug mode).
This is a simple configuration that can be set in a few alternative ways:
1. Via code
// If you are a commercial business and have
// purchased commercial licenses use the static property
// LicenseContext of the ExcelPackage class :
ExcelPackage.LicenseContext = LicenseContext.Commercial;
// If you use EPPlus in a noncommercial context
// according to the Polyform Noncommercial license:
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
using(var package = new ExcelPackage(new FileInfo("MyWorkbook.xlsx")))
{
}
2. Via appSettings.json
{
"EPPlus": {
"ExcelPackage": {
"LicenseContext": "Commercial"
}
}
}
3. Via app/web.config
<appSettings>
<!--The license context used-->
<add key="EPPlus:ExcelPackage.LicenseContext" value="NonCommercial" />
</appSettings>
4. Set the environment variable 'EPPlusLicenseContext'
This might be the easiest way of configuring this. Just as above, set the variable to Commercial or NonCommercial depending on your usage.
Important! The environment variable should be set at the user level.