Configure IronXL License in web.config (C#)
해당 문제는 IronXL 버전 2024.3.20 부터 해결 되었습니다.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronXL must be licensed for development.
IronXL 구버전, 특히 2023.4.13 버전과 2024.3.20 버전 사이에는 다음과 같은 라이선스 문제가 있는 것으로 알려져 있습니다.
- ASP.NET 프로젝트
- .NET Framework 버전 4.6.2 이상
Web.config 파일에 저장된 키는 제품에서 인식되지 않고 사용되지 않습니다 .
해결 방법
이 문제를 해결하려면 코드에서 ConfigurationManager를 사용하여 Web.config 파일에서 라이선스 키를 가져온 다음 License.LicenseKey 속성에 적용하는 것이 좋습니다.
예:
다음은 라이선스 키를 Web.config 파일에 저장하는 방법의 예입니다.
<configuration>
...
<appSettings>
<add key="IronXL.LicenseKey" value="IronXL-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronXL.LicenseKey" value="IronXL-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
위와 같은 XML 파일 설정을 통해 ConfigurationManager를 사용하여 라이선스 키 값을 검색하고 IronXL.License.LicenseKey 속성에 설정할 수 있습니다.
using System.Configuration;
// Retrieve the license key from the Web.config appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronXL.LicenseKey"];
// Apply the retrieved license key to the IronXL component
IronXL.License.LicenseKey = licenseKey;
using System.Configuration;
// Retrieve the license key from the Web.config appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronXL.LicenseKey"];
// Apply the retrieved license key to the IronXL component
IronXL.License.LicenseKey = licenseKey;
Imports System.Configuration
' Retrieve the license key from the Web.config appSettings section
Private licenseKey As String = ConfigurationManager.AppSettings("IronXL.LicenseKey")
' Apply the retrieved license key to the IronXL component
IronXL.License.LicenseKey = licenseKey
이 예에서 ConfigurationManager.AppSettings는 Web.config에서 IronXL.LicenseKey의 값을 가져오는 데 사용됩니다. 검색된 라이선스 키는 IronXL 구성 요소가 제대로 작동하도록 IronXL.License.LicenseKey로 설정됩니다.

