Author Topic: EPPlus New Version License  (Read 2815 times)

AabeckControls

  • Full Member
  • ***
  • Posts: 193
    • View Profile
EPPlus New Version License
« on: April 14, 2021, 09:49:26 AM »
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:

Code: [Select]
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.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: EPPlus New Version License
« Reply #1 on: April 18, 2021, 05:07:25 PM »
I ran into this when I updated an HMI from about 5 years ago. I just took the original DLL to get the update working. I'd too be curious if anyone has experienced any new features or critical bug fixes made since the license change.

cojuancarlos

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: EPPlus New Version License
« Reply #2 on: October 16, 2023, 10:18:30 AM »
I have this issue. What do you mean by took the Original DLL?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: EPPlus New Version License
« Reply #3 on: October 16, 2023, 10:33:43 AM »
I have this issue. What do you mean by took the Original DLL?
An older version of the DLL

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: EPPlus New Version License
« Reply #4 on: October 17, 2023, 04:24:14 PM »
It's been 4 years since v5.
There were performance improvement, bug fixes, added features ...
It's probably a good idea to use the latest version 6.x.
Simply add the license context.
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================