Fehlerbehebung bei der IronPrint-Lizenzkonfiguration
Das Problem wurde mit IronPrint-Version 2024.3.6 behoben.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
Bei älteren IronPrint-Versionen, insbesondere solchen, die vor der Version 2024.3.6 veröffentlicht wurden, gibt es ein bekanntes Lizenzproblem in:
- ASP.NET-Projekte
.NET Framework Version >= 4.6.2
Der im
Web.config
-Datei gespeicherte Schlüssel wird NICHT vom Produkt aufgenommen und verwendet.
Abhilfe
Um dieses Problem zu beheben, wird empfohlen, den Lizenzschlüssel aus der Web.config
-Datei mit ConfigurationManager im Code abzurufen und ihn dann auf die License.LicenseKey-Eigenschaft anzuwenden.
Beispiel:
<configuration>
...
<appSettings>
<add key="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
Mit der oben bereitgestellten XML-Datei können wir ConfigurationManager verwenden, um den Lizenzschlüsselwert abzurufen und an die IronPrint.License.LicenseKey-Eigenschaft zu übergeben.
using System.Configuration;
string licenseKey = ConfigurationManager.AppSettings ["IronPrint.LicenseKey"];
IronPrint.License.LicenseKey = licenseKey;
using System.Configuration;
string licenseKey = ConfigurationManager.AppSettings ["IronPrint.LicenseKey"];
IronPrint.License.LicenseKey = licenseKey;
Imports System.Configuration
Private licenseKey As String = ConfigurationManager.AppSettings ("IronPrint.LicenseKey")
IronPrint.License.LicenseKey = licenseKey