Web.config Dosyasında Lisans Anahtarını 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 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>
XML

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
$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 64,787 | Sürüm: 2026.4 just released
Still Scrolling Icon

Hala Kaydiriyor musunuz?

Hızlı bir kanit mi istiyorsunuz? PM > Install-Package IronQR
bir örneği çalıştır URL'inin bir QR koduna dönüşünü izle.