web.config'te IronBarcode Lisans Kurulumu
Bu sorun, IronBarcode'in 2024.3.2 sürümünde çözüldü.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronBarcode must be licensed for development.
Özellikle 2023.4.1 ve 2024.3.2 sürümleri arasında olan eski IronBarcode sürümleri için bilinen bir lisanslama sorunu:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Bir Web.config dosyasında saklanan anahtar, ürün tarafından KULLANILMAYACAKTIR.
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 önerilir.
Örnek:
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Yukarıda sağlanan XML dosyası ile, lisans anahtarı değerini almak ve IronBarCode.License.LicenseKey özelliğine iletmek için ConfigurationManager kullanabiliriz.
using System.Configuration;
// Retrieve the license key from appSettings in the Web.config file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];
// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;
using System.Configuration;
// Retrieve the license key from appSettings in the Web.config file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];
// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;
Imports System.Configuration
' Retrieve the license key from appSettings in the Web.config file
Private licenseKey As String = ConfigurationManager.AppSettings("IronBarCode.LicenseKey")
' Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey

