IronPrint Lisans Yapılandırma Sorun Giderme
Sorun çözüldü IronPrint versiyonu 2024.3.6 itibarıyla.
# 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.
Eski IronPrint sürümleri, özellikle 2024.3.6 sürümünden önce yayınlananlar için, bilinen bir lisanslama sorunu bulunmaktadır:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Bir Web.config dosyasında saklanan anahtar KULLANILMAYACAK ve ürün tarafından alınmayacaktır.
Geçici Çözüm
Bu sorunu çözmek için, lisans anahtarını Web.config dosyasından ConfigurationManager kullanarak koddaki almanız ve ardından 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>
Yukarıda sağlanan XML dosyası ile, lisans anahtarını ConfigurationManager kullanarak 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.");
}
}
}
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 Namespace
Yukarıdaki örnekte, ConfigurationManager.AppSettings lisans anahtarını doğrudan Web.config 'den almak için kullanılmaktadır. Anahtar daha sonra IronPrint bileşeni için LicenseKey olarak ayarlanır ve bu da uygulamanın doğru çalışması için gerekli lisansa sahip olmasını sağlar.

