Getting started-Setting the license

License

From EPPlus 8 and later versions, you need to specify the license before using EPPlus. This must be set both in the development and in the runtime environments.

Information to developers

Installation: Install EPPlus 8 from the EPPlus nuget feed.

If you are a commercial business, you need a commercial license that can be purchased here.
Please see Getting started-Commercial use, if you already have a commercial license.

For noncommercial use, you need to specify who is using EPPlus under the Polyform Noncommercial License. You can either set the license as noncommercial personal use or noncommercial organizational use. Doing so will tag any workbook created with 'EPPlus noncommercial use' and reserve the Comment property for a reference to the Polyform Noncommercial License.

The license can be set in three different ways:

1. Use the License property on the ExcelPackage class
// If you are a Noncommercial organization.
ExcelPackage.License.SetNonCommercialOrganization("My Noncommercial organization"); //This will also set the Company property to the organization name provided in the argument.
using(var package = new ExcelPackage(new FileInfo("MyWorkbook.xlsx")))
{

}
        
            // If you use EPPlus for Noncommercial personal use.
ExcelPackage.License.SetNonCommercialPersonal("My Name"); //This will also set the Author property to the name provided in the argument.
using(var package = new ExcelPackage(new FileInfo("MyWorkbook.xlsx")))
{

}
        
2. appSettings.json
            {
    {
    "EPPlus": {
        "ExcelPackage": {
            "LicenseContext": "NonCommercialOrganization:The noncommercial organization" //Please provide the name of the noncommercial organization you represent.
            }
        }
    }
}
{
    {
    "EPPlus": {
        "ExcelPackage": {
            "LicenseContext": "NonCommercialPersonal:Your Name"     //Please provide your name                               
            }
        }
    }
}
        

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

            
                <appSettings>
                   <add key="EPPlus:ExcelPackage:LicenseContext" value="NonCommercialPersonal:Your name" />
                </appSettings>

                <appSettings>
                   <add key="EPPlus:ExcelPackage:LicenseContext" value="NonCommercialOrganization:Your organization" />
                </appSettings>
            
            
3. Set the environment variable 'EPPlusLicense'

This might be the easiest way of configuring this. The example below is using the SETX command in the Windows console.

Noncommercial organization...

            > SETX EPPlusLicense "NonCommercialOrganization:The Noncommercial organization"
            

Personal use...

            > SETX EPPlusLicense "NonCommercialPersonal:Your Name"
            
The variable can be set on the process, user or machine level.
Developer resources

A more detailed getting started information is available in our developer wiki.

Our sample projects on github is a good starting point. Here you will also find the source code for EPPlus, our issue tracker and branches for our ongoing new development.

More developer information can be found here.