IronBarcode Lizenz Einrichtung in web.config
Dieses Problem wurde in der 2024.3.2 Version von IronBarcode behoben.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronBarcode must be licensed for development.
Für ältere IronBarcode-Versionen, insbesondere diejenigen zwischen den Versionen 2023.4.1 und 2024.3.2, gibt es ein bekanntes Lizenzierungsproblem in:
- ASP.NET-Projekten
- .NET Framework Version >= 4.6.2
Der in einer Web.config-Datei gespeicherte Schlüssel wird vom Produkt NICHT aufgenommen und verwendet.
Problemumgehung
Um dieses Problem zu beheben, wird empfohlen, den Lizenzschlüssel aus der Web.config-Datei mithilfe von ConfigurationManager im Code abzurufen und anschließend auf die License.LicenseKey-Eigenschaft anzuwenden.
Beispiel:
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Mit der oben bereitgestellten XML-Datei können wir ConfigurationManager verwenden, um den Lizenzschlüsselwert abzurufen und ihn an die IronBarCode.License.LicenseKey-Eigenschaft zu übergeben.
using System.Configuration;
// Retrieve the license key from appSettings in the Web.config file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];
// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;
using System.Configuration;
// Retrieve the license key from appSettings in the Web.config file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];
// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;
Imports System.Configuration
' Retrieve the license key from appSettings in the Web.config file
Private licenseKey As String = ConfigurationManager.AppSettings("IronBarCode.LicenseKey")
' Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey

