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

