IronWord Lisans Anahtarı ASP.NET Yapılandırması
Sorun, IronWord 2024.3.5 sürümü itibariyle çözüldü.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWord must be licensed for development.
Özellikle 2024.3.5 sürümünden önce yayınlanan eski IronWord sürümleri için bilinen bir lisanslama sorunu bulunmaktadır:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Ürün, Web.config dosyasında saklanan anahtarı KULLANMAYACAK.
Geçici Çözüm
Bu sorunu çözmek için, kodda ConfigurationManager kullanarak lisans anahtarını Web.config dosyasından almak ve ardından License.LicenseKey özelliğine uygulamak önerilmektedir.
Örnek:
<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>
Yukarıda sağlanan XML dosyasıyla, lisans anahtarı değerini almak ve IronWord.License.LicenseKey özelliğine aktarmak için ConfigurationManager kullanabiliriz.
// 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

