Web.config Dosyasında Lisans Anahtarını Ayarlama
Sorun IronQR sürüm 2024.3.2 itibariyle cozuldu.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronQR must be licensed for development.
Eski IronQR sürümleri için, özellikle 2024.3.2 sürümünden önce yayımlananlar, şu lisanslama sorunları bulunmaktadır:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Web.config dosyasinda saklanan anahtar ürün tarafından KULLANILMAYACAKTIR.
Geçici Çözüm
Bu sorunu çözmek için lisans anahtarını Web.config dosyasından kod içinde ConfigurationManager kullanarak almanı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>
<configuration>
...
<appSettings>
<add key="IronQr.LicenseKey" value="IronQR-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Yukarıda sağlanan XML dosyası ile, lisans anahtarını değeri almak ve IronQr.License.LicenseKey özelliğine iletmek için ConfigurationManager kullanabiliriz.
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;
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 = licenseKey

