Cómo Configurar la Licencia de IronXL en web.config para C
El problema se ha resuelto a partir de la versión 2024.3.20 de IronXL .
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronXL must be licensed for development.
Para las versiones anteriores de IronXL, específicamente aquellas entre las versiones 2023.4.13 y 2024.3.20, existe un problema conocido de licenciamiento en:
- Proyectos ASP.NET
- Versión de .NET Framework >= 4.6.2
La clave almacenada en un archivo Web.config NO será recogida ni utilizada por el producto.
Solución alternativa
Para solucionar este problema, se recomienda recuperar la clave de licencia del archivo Web.config usando ConfigurationManager en el código y luego aplicarla a la propiedad License.LicenseKey.
Ejemplo:
A continuación se muestra un ejemplo de cómo almacenar la clave de licencia en un archivo Web.config:
<configuration>
...
<appSettings>
<add key="IronXL.LicenseKey" value="IronXL-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronXL.LicenseKey" value="IronXL-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Con la configuración del archivo XML anterior, podemos usar ConfigurationManager para recuperar el valor de la clave de licencia y establecerlo en la propiedad IronXL.License.LicenseKey:
using System.Configuration;
// Retrieve the license key from the Web.config appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronXL.LicenseKey"];
// Apply the retrieved license key to the IronXL component
IronXL.License.LicenseKey = licenseKey;
using System.Configuration;
// Retrieve the license key from the Web.config appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronXL.LicenseKey"];
// Apply the retrieved license key to the IronXL component
IronXL.License.LicenseKey = licenseKey;
Imports System.Configuration
' Retrieve the license key from the Web.config appSettings section
Private licenseKey As String = ConfigurationManager.AppSettings("IronXL.LicenseKey")
' Apply the retrieved license key to the IronXL component
IronXL.License.LicenseKey = licenseKey
En este ejemplo, se utiliza ConfigurationManager.AppSettings para recuperar el valor de IronXL.LicenseKey de Web.config. Luego, la clave de licencia recuperada se establece en IronXL.License.LicenseKey para garantizar que los componentes IronXL puedan funcionar correctamente.

