EPPlus 5/6/7

LicenseException
We are working on translating our web site to other languages with a machine learning tool (please excuse that grammar/tonality/wordings might not be 100% perfect). This work is not completed yet, but we hope that this first release will be useful. You can switch to your preferred language in the dropdown below or in the top menu.

Why do I get this exception?

New major version - new license model

EPPlus has up until version 4 been licensed under the LGPL open source license, but from version 5 (released early 2020) it is licensed under the Polyform Noncommercial 1.0.0 license. Following EPPlus 5, we have also released EPPlus 6 in April 2022..

Polyform Noncommercial 1.0

You can find more details about the license change and why it was done here. For more information on our Commercial licenses, see our License FAQ

License FAQ »

Commercial licenses can be purchased here on our website.

Development of EPPlus is now done via our company EPPlus Software AB and this has enabled us to put all our efforts into improving EPPlus and to be more responsive and available to our customers/users.

License Exception

The purpose of this Exception is to make all EPPlus users aware of the license change. You don't need a specific license key to use EPPlus 5/6, see below how to proceed.

This exception is only thrown when a debugger is attached, so you don't have to configure this in a production/release environment.

How do I get rid of the LicenseException?

There are three alternative ways:

1. Use the LicenseContext property on the ExcelPackage class
            
// 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. appSettings.json
        
{
    {
    "EPPlus": {
        "ExcelPackage": {
            "LicenseContext": "Commercial" //The license context used
            }
        }
    }
}
        
        

...or in the app.config...

            

<appSettings>
    <!--The license context used-->
    <add key="EPPlus:ExcelPackage.LicenseContext" value="NonCommercial" />
</appSettings>

            
            
3. Set the environment variable 'EPPlusLicenseContext'

This might be the easiest way of configuring this. Set the variable to one of the two following values:

  • Commercial
  • NonCommercial

Important! The environment variable should be set at the user or process level.