Web.config에서 라이선스 키 설정하기
문제는 IronQR 버전 2024.3.2에서 해결되었습니다.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronQR must be licensed for development.
이전 IronQR 버전, 특히 2024.3.2 이전 버전에 대해서는 다음과 같은 라이선스 문제가 있는 것으로 알려져 있습니다.
- ASP.NET 프로젝트
- .NET Framework 버전 4.6.2 이상
Web.config 파일에 저장된 키는 제품에서 사용되지 않습니다.
해결 방법
이 문제를 해결하기 위해 코드에서 ConfigurationManager를 사용하여 Web.config 파일에서 라이선스 키를 가져와 License.LicenseKey 속성에 적용하는 것이 권장됩니다.
예:
<configuration>
...
<appSettings>
<add key="IronQr.LicenseKey" value="IronQR-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronQr.LicenseKey" value="IronQR-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
위에서 제공한 XML 파일을 사용하여 ConfigurationManager를 사용해 라이선스 키 값을 가져와 IronQr.License.LicenseKey 속성에 전달할 수 있습니다.
using System.Configuration;
// Retrieve the license key from the Web.config file's appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronQr.LicenseKey"];
// Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKey;
using System.Configuration;
// Retrieve the license key from the Web.config file's appSettings section
string licenseKey = ConfigurationManager.AppSettings["IronQr.LicenseKey"];
// Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKey;
Imports System.Configuration
' Retrieve the license key from the Web.config file's appSettings section
Dim licenseKey As String = ConfigurationManager.AppSettings("IronQr.LicenseKey")
' Apply the retrieved license key to the IronQR LicenseKey property
IronQr.License.LicenseKey = licenseKey

