IronPrint Lisans Yapılandırması Sorun Giderme

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

Sorun, IronPrint sürüm 2024.3.6 ile çözülmüştür.

# This shell output shows an unhandled exception error due to missing license for IronPrint.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
# This shell output shows an unhandled exception error due to missing license for IronPrint.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPrint must be licensed for development.
SHELL

Eski IronPrint sürümlerinde, özellikle 2024.3.6 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="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
  </appSettings>
  ...
</configuration>
<configuration>
  ...
  <appSettings>
    <add key="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
  </appSettings>
  ...
</configuration>
XML

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

using System;
using System.Co/nfiguration;

namespace IronPrintLicenseSetup
{
    class Program
    {
        static void Main()
        {
            // Retrieve the license key from the appSettings section of the Web.co/nfig file.
            string licenseKey = ConfigurationManager.AppSettings["IronPrint.LicenseKey"];

            // Apply the retrieved license key to the IronPrint's LicenseKey property.
            IronPrint.License.LicenseKey = licenseKey;

            // Notify user that the license key has been applied.
            Console.WriteLine("License Key has been applied successfully.");
        }
    }
}
using System;
using System.Co/nfiguration;

namespace IronPrintLicenseSetup
{
    class Program
    {
        static void Main()
        {
            // Retrieve the license key from the appSettings section of the Web.co/nfig file.
            string licenseKey = ConfigurationManager.AppSettings["IronPrint.LicenseKey"];

            // Apply the retrieved license key to the IronPrint's LicenseKey property.
            IronPrint.License.LicenseKey = licenseKey;

            // Notify user that the license key has been applied.
            Console.WriteLine("License Key has been applied successfully.");
        }
    }
}
Imports System
Imports System.Configuration

Namespace IronPrintLicenseSetup
    Class Program
        Shared Sub Main()
            ' Retrieve the license key from the appSettings section of the Web.config file.
            Dim licenseKey As String = ConfigurationManager.AppSettings("IronPrint.LicenseKey")

            ' Apply the retrieved license key to the IronPrint's LicenseKey property.
            IronPrint.License.LicenseKey = licenseKey

            ' Notify user that the license key has been applied.
            Console.WriteLine("License Key has been applied successfully.")
        End Sub
    End Class
End Namespace
$vbLabelText   $csharpLabel

Yukarıdaki örnekte, ConfigurationManager.AppSettings, lisans anahtarını doğrudan Web.co/nfig'den almak için kullanılır. Anahtar, IronPrint bileşeni için LicenseKey olarak ayarlanır ve uygulamanın doğru şekilde çalışması için gerekli lisansa sahip olmasını sağlar.

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 41,154 | 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 IronPrint
bir örnek çalıştır belgenizin yazıcıya ulaşmasını izleyin.