Configuración de la Licencia de IronBarcode en web.config
This problem has been resolved in the 2024.3.2versión de IronBarcode.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronBarcode must be licensed for development.
Para versiones anteriores de IronBarcode, específicamente aquellas entre las versiones2023.4.1 y2024.3.2hay un problema conocido de licencias en:
- **Proyectos ASP.NET
Versión de .NET Framework >= 4.6.2
La clave almacenada en un archivo
Web.config
NO será recogida y utilizada por el producto.
Solución
Para solucionar este problema, se recomienda recuperar la clave de licencia del archivo Web.config
utilizando ConfigurationManager en el código, y luego aplicarla a la propiedad License.LicenseKey.
Ejemplo:
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Con el fichero XML proporcionado anteriormente, podemos utilizar ConfigurationManager para recuperar el valor de la clave de licencia y pasarlo a la propiedad IronBarCode.License.LicenseKey.
using System.Configuration;
string licenseKey = ConfigurationManager.AppSettings ["IronBarCode.LicenseKey"];
IronBarCode.License.LicenseKey = licenseKey;
using System.Configuration;
string licenseKey = ConfigurationManager.AppSettings ["IronBarCode.LicenseKey"];
IronBarCode.License.LicenseKey = licenseKey;
Imports System.Configuration
Private licenseKey As String = ConfigurationManager.AppSettings ("IronBarCode.LicenseKey")
IronBarCode.License.LicenseKey = licenseKey