Lizenzschlüssel in Web.config festlegen
Das Problem wurde mit IronQR Version 2024.3.2 behoben .
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronQR must be licensed for development.
Für ältere IronQR-Versionen, speziell die vor Version 2024.3.2 veröffentlicht wurden, gibt es ein bekanntes Lizenzproblem in:
- ASP.NET-Projekten
- .NET Framework Version >= 4.6.2
Der in einer Web.config Datei gespeicherte Schlüssel wird vom Produkt NICHT erkannt und verwendet.
Problemumgehung
Um dieses Problem zu beheben, wird empfohlen, den Lizenzschlüssel aus der Datei Web.config mithilfe des ConfigurationManager im Code abzurufen und ihn dann auf die Eigenschaft License.LicenseKey anzuwenden.
Beispiel:
<configuration>
...
<appSettings>
<add key="IronQr.LicenseKey" value="IronQR-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronQr.LicenseKey" value="IronQR-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Mit der oben angegebenen XML-Datei können wir mithilfe des ConfigurationManager den Lizenzschlüsselwert abrufen und ihn an die Eigenschaft IronQr.License.LicenseKey übergeben.
using System.Configuration;
// Retrieve the license key from the Web.config file's appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronQr.LicenseKey"];
// Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKey;
using System.Configuration;
// Retrieve the license key from the Web.config file's appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronQr.LicenseKey"];
// Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKey;
Imports System.Configuration
' Retrieve the license key from the Web.config file's appSettings section
Dim licenseKey As String = ConfigurationManager.AppSettings("IronQr.LicenseKey")
' Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKey

