IronWord-Lizenzschlüssel in der ASP.NET-Konfiguration
Das Problem wurde mit IronWord Version 2024.3.5 behoben .
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWord must be licensed for development.
Für ältere IronWord-Versionen, insbesondere die vor Version 2024.3.5 veröffentlicht wurden, 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 erkannt und verwendet.
Problemumgehung
Um dieses Problem zu beheben, wird empfohlen, den Lizenzschlüssel mithilfe des ConfigurationManager im Code aus der Datei Web.config abzurufen und ihn dann auf die Eigenschaft License.LicenseKey anzuwenden.
Beispiel:
<configuration>
...
<appSettings>
<add key="IronWord.LicenseKey" value="IRONWORD.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronWord.LicenseKey" value="IRONWORD.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 IronWord.License.LicenseKey-Eigenschaft zu übergeben.
// Import the necessary namespace for ConfigurationManager
using System.Configuration;
// Retrieve the license key from the AppSettings in Web.config
string licenseKey = ConfigurationManager.AppSettings["IronWord.LicenseKey"];
// Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey;
// Import the necessary namespace for ConfigurationManager
using System.Configuration;
// Retrieve the license key from the AppSettings in Web.config
string licenseKey = ConfigurationManager.AppSettings["IronWord.LicenseKey"];
// Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey;
' Import the necessary namespace for ConfigurationManager
Imports System.Configuration
' Retrieve the license key from the AppSettings in Web.config
Private licenseKey As String = ConfigurationManager.AppSettings("IronWord.LicenseKey")
' Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey

