Web.config içinde Lisans Anahtarı Ayarlama
Bu sorun IronPDF sürümünden beri çözüldü 2024.3.3.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronPDF must be licensed for development.
Eskiden IronPDF sürümleri, özellikle 2023.4.4 ve 2024.3.3 arasındaki sürümler için bilinen bir lisanslama sorunu var:
- ASP.NET projeleri
- .NET Framework sürümü >= 4.6.2
Web.config dosyasında saklanan anahtar ürün tarafından KULLANILMAYACAK ve ALINMAYACAKTIR.
Geçici Çözüm
Bu sorunu çözmek için, kod içinde ConfigurationManager kullanarak lisans anahtarını Web.config dosyasından almanız ve ardından License.LicenseKey özelliğine uygulamanız önerilir.
Örnek:
<configuration>
...
<appSettings>
<add key="IronPdf.LicenseKey" value="IRONPDF-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Yukarıda sağlanan XML dosyası ile ConfigurationManager kullanarak lisans anahtarı değerini alabilir ve bunu IronPdf.License.LicenseKey özelliğine iletebiliriz.
using System.Configuration;
class Program
{
static void Main()
{
// Retrieve the license key from the Web.config file
string licenseKey = ConfigurationManager.AppSettings["IronPdf.LicenseKey"];
// Apply the license key to the IronPdf library
IronPdf.License.LicenseKey = licenseKey;
// Additional processing can continue here
}
}Imports System.Configuration
Class Program
Shared Sub Main()
' Retrieve the license key from the Web.config file
Dim licenseKey As String = ConfigurationManager.AppSettings("IronPdf.LicenseKey")
' Apply the license key to the IronPdf library
IronPdf.License.LicenseKey = licenseKey
' Additional processing can continue here
End Sub
End ClassImports System.Configuration
Class Program
Shared Sub Main()
' Retrieve the license key from the Web.config file
Dim licenseKey As String = ConfigurationManager.AppSettings("IronPdf.LicenseKey")
' Apply the license key to the IronPdf library
IronPdf.License.LicenseKey = licenseKey
' Additional processing can continue here
End Sub
End ClassCurtis 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.