IronPrint Lisans Yapılandırma Sorun Giderme
Bu sorun, IronPrint'in son sürümlerinde ele alınmış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.
Eski IronPrint sürümleri için aşağıdaki bilinen bir lisanslama sorunu vardır:
- 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, lisan anahtarının Web.config dosyasından ConfigurationManager kullanarak kodda alınması ve ardından License.LicenseKey özelliğine uygulanması önerilir.
Örnek:
<configuration>
...
<appSettings>
<add key="IronPrint.LicenseKey" value="IRONPRINT.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
Yukarıda sağlanan XML dosyası ile ConfigurationManager kullanarak lisans anahtar değerini alabilir ve IronPrint.License.LicenseKey özelliğine iletebiliriz.
using System;
using System.Configuration;
namespace IronPrintLicenseSetup
{
class Program
{
static void Main()
{
// Retrieve the license key from the appSettings section of the Web.config 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
Friend 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 NamespaceImports System
Imports System.Configuration
Namespace IronPrintLicenseSetup
Friend 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 NamespaceYukarıdaki örnekte, lisans anahtarını doğrudan Web.config'den almak için ConfigurationManager.AppSettings kullanılır. Anahtar daha sonra IronPrint bileşeni için LicenseKey olarak ayarlanır ve uygulamanın doğru çalışması için gerekli lisansa sahip olmasını sağlar.
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ılandırılmış, görsel olarak çekici kılavuzlar oluşturmayı seviyor.