Web.config içinde Lisans Anahtarı Ayarlama
Problem, IronQR sürüm 2024.3.2 itibariyle çözüldü.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronQR must be licensed for development.
Özellikle sürüm 2024.3.2 öncesinde yayınlanan daha eski IronQR sürümleri için, bilinen bir lisanslama sorunu vardır:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Anahtar, bir Web.config dosyasında depolandığında, ürün tarafından KULLANILMAYACAKTIR.
Geçici Çözüm
Bu sorunu çözmek için, lisans anahtarını kod içinde ConfigurationManager kullanarak Web.config dosyasından kurtarmanız ve ardından License.LicenseKey özelliğine uygulamanız önerilir.
Örnek:
<configuration>
...
<appSettings>
<add key="IronQR.LicenseKey" value="IronQR-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Yukarıda verilen XML dosyası ile, lisans anahtar değerini almak için ConfigurationManager kullanabilir ve IronQr.License.LicenseKey özelliğine iletebiliriz.
using System.Configuration;
// Retrieve the license key from the Web.config file's appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronQR.LicenseKey"];
// Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKey;Imports System.Configuration
' Retrieve the license key from the Web.config file's appSettings section
Dim licenseKey As String = ConfigurationManager.AppSettings("IronQR.LicenseKey")
' Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKeyImports System.Configuration
' Retrieve the license key from the Web.config file's appSettings section
Dim licenseKey As String = ConfigurationManager.AppSettings("IronQR.LicenseKey")
' Apply the retrieved license key to the IronQR LicenseKey property
IronQr.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.