Web.co/nfig'de Lisans Anahtarı Ayarlama

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

Sorun, IronQR sürüm 2024.3.2 ile çözülmüştür.

Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronQR must be licensed for development.

Eski IronQR sürümlerinde, özellikle 2024.3.2 sürümünden önce yayınlananlarda, şu lisans sorunu bilinmektedir:

  • ASP.NET projeleri
  • .NET Framework sürümü >= 4.6.2

Web.co/nfig dosyasında depolanan anahtar, ürün tarafından ALINMAYACAK ve KULLANILMAYACAKTIR.

Çözüm

Bu sorunu çözmek için, koddaki ConfigurationManager'ı kullanarak Web.co/nfig dosyasından lisans anahtarını almanız ve ardından bunu 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>
XML

Yukarıda sağlanan XML dosyası ile ConfigurationManager'ı kullanarak lisans anahtarı değerini alabilir ve bunu IronQr.License.LicenseKey özelliğine aktarabiliriz.

using System.Co/nfiguration;

// Retrieve the license key from the Web.co/nfig 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.Co/nfiguration;

// Retrieve the license key from the Web.co/nfig 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
$vbLabelText   $csharpLabel
Curtis Chau
Teknik Yazar

Curtis 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ı...

Daha Fazla Oku
Başlamaya Hazır mısınız?
Nuget İndirmeler 67,270 | Sürüm: 2026.5 just released
Still Scrolling Icon

Hâlâ Kaydırıyor Musunuz?

Hızlıca kanıt ister misiniz? PM > Install-Package IronQR
bir örnek çalıştırın url'nizin bir QR koda dönüşmesini izleyin.