web.config'te IronBarcode Lisans Kurulumu

This article was translated from English: Does it need improvement?
Translated
View the article in English

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>
XML

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
$vbLabelText   $csharpLabel
Curtis Chau
Teknik Yazar

Curtis Chau, Bilgisayar Bilimleri alanında lisans derecesine sahiptir (Carleton Üniversitesi) ve Node.js, TypeScript, JavaScript ve React konularında uzmanlaşmış ön uç geliştirme üzerine uzmanlaşmıştır. Kullanıcı dostu ve estetik açıdan hoş arayüzler tasarlamaya tutkuyla bağlı olan Curtis, modern çerç...

Daha Fazlasını Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 2,169,908 | Sürüm: 2026.4 just released
Still Scrolling Icon

Hala Kaydiriyor musunuz?

Hızlı bir kanit mi istiyorsunuz? PM > Install-Package BarCode
bir örnek çalıştırın dize barkod haline geldiğini görün.