ASP.NET Yapılandırmasında IronWord Lisans Anahtarı
Sorun, IronWord sürümü 2024.3.5 itibarıyla çözüldü.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWord must be licensed for development.
Eski IronWord sürümleri için, özellikle de sürüm 2024.3.5'den önce yayımlananlar için, bilinen bir lisanslama sorunu bulunmaktadır:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Web.config dosyasında depolanan anahtar, ürün tarafından KULLANILMAYACAKTIR.
Geçici Çözüm
Bu sorunu gidermek için, lisans anahtarını Web.config dosyasından ConfigurationManager kullanarak kodda almak ve ardından License.LicenseKey özelliğine uygulamak önerilmektedir.
Örnek:
<configuration>
...
<appSettings>
<add key="IronWord.LicenseKey" value="IRONWORD.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
Yukarıda verilen XML dosyası ile ConfigurationManager kullanarak lisans anahtarı değerini alabilir ve IronWord.License.LicenseKey özelliğine iletebiliriz.
// 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' 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 = licenseKeyCurtis Chau, Bilgisayar Bilimleri alanında Lisans Derecesine (Carleton Üniversitesi) sahip ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirmeyle ilgileniyor. Sezgisel ve estetik açıdan hoş kullanıcı arayüzleri oluşturma tutkunu, Curtis modern çerçevelerle çalışmayı ve iyi yapılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.