ASP.NET Yapılandırmasında IronWord Lisans Anahtarı
Sorun, IronWord sürüm 2024.3.5 ile çözülmüştür.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWord must be licensed for development.
Eski IronWord sürümlerinde, özellikle 2024.3.5 sürümünden önce yayınlananlarda, şu lisans sorunu bilinmektedir:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Web.co/nfig dosyasında depolanan anahtar, ürün tarafından ALINMAYACAK ve KULLANILMAYACAKTIR.
Çözüm
Bu sorunu çözmek için, koddaki ConfigurationManager'ı kullanarak Web.co/nfig dosyasından lisans anahtarını almanız ve ardından bunu License.LicenseKey özelliğine uygulamanız önerilir.
Ö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ı ile ConfigurationManager'ı kullanarak lisans anahtarı değerini alabilir ve bunu IronWord.License.LicenseKey özelliğine aktarabiliriz.
// Import the necessary namespace for ConfigurationManager
using System.Co/nfiguration;
// Retrieve the license key from the AppSettings in Web.co/nfig
string licenseKey = ConfigurationManager.AppSettings["IronWord.LicenseKey"];
// Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey;
// Import the necessary namespace for ConfigurationManager
using System.Co/nfiguration;
// Retrieve the license key from the AppSettings in Web.co/nfig
string licenseKey = ConfigurationManager.AppSettings["IronWord.LicenseKey"];
// Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey;
Imports System.Configuration
' Retrieve the license key from the AppSettings in Web.config
Dim licenseKey As String = ConfigurationManager.AppSettings("IronWord.LicenseKey")
' Set the license key for IronWord
IronWord.License.LicenseKey = licenseKey

