Using IronXL License Keys

If you decide to purchase a license for IronXL, you will instantly receive a license key as soon as your payment has cleared. This License will be displayed on the checkout completion screen and also be sent by email.

Setting the IronXL license key inside your code

Add this code to the startup of your application, your before IronXL is used.

IronXL.License.LicenseKey = "IRONXL-MYLICENSE-KEY-1EF01";
IronXL.License.LicenseKey = "IRONXL-MYLICENSE-KEY-1EF01";
IronXL.License.LicenseKey = "IRONXL-MYLICENSE-KEY-1EF01"
VB   C#

Setting a key in your Web.Config or App.Config

To apply a key globally to your application using Web.Config or App.Config, add the following key to your config file in appSettings.

<configuration>
   ....
   <appSettings>
      <add key="IronXL.LicenseKey" value="IRONXL-MYLICENSE-KEY-1EF01"/>
   </appSettings>
   ....
</configuration>

Setting your IronXL license key using Web.Config or App.Config in .Net Framework Applications

To apply a key globally to your application using Web.Config or App.Config, add the following key to your config file in appSettings.

<configuration>
   ....
   <appSettings>
      <add key="IronXL.LicenseKey" value="IronXL-MYLICENSE-KEY-1EF01"/>
   </appSettings>
   ....
</configuration>

Ensure that IronXL.License.IsLicensed returns true to verify.

Setting your IronXL license key using a .Net Core appsettings.json file

To apply a key globally to your application to a .Net Core:

  • Add a JSON file to your project called appsettings.json in the root directory of your project
  • Add a 'IronXL.LicenseKey' key to your JSON config file. The value should be your license key.
  • Ensure that the file properties include Copy to Output Directory: Copy always
  • Ensure that IronXL.License.IsLicensed returns true to verify.

File: appsettings.json

{

    "IronXL.LicenseKey":"IronXL-MYLICENSE-KEY-1EF01"

}  

Test if your key has been installed correctly

// Check if a given license key string is valid.
bool result = IronXL.License.IsValidLicense("IronXL-MYLICENSE-KEY-1EF01");

// Check if IronXL is licensed successfully 
bool is_licensed = IronXL.License.IsLicensed;
// Check if a given license key string is valid.
bool result = IronXL.License.IsValidLicense("IronXL-MYLICENSE-KEY-1EF01");

// Check if IronXL is licensed successfully 
bool is_licensed = IronXL.License.IsLicensed;
' Check if a given license key string is valid.
Dim result As Boolean = IronXL.License.IsValidLicense("IronXL-MYLICENSE-KEY-1EF01")

' Check if IronXL is licensed successfully 
Dim is_licensed As Boolean = IronXL.License.IsLicensed
VB   C#

Note: After adding a license always remember to clean and republish you application to avoid potential mistakes in deployment.