web.co/nfig 파일의 IronOCR 라이선스 설정
이 문제는 IronZip 버전 2024.3.3부터 해결되었습니다.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronZip must be licensed for development.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronZip must be licensed for development.
2024.3.3 버전 이전에 출시된 구형 IronZip 버전의 경우, 다음에서 알려진 라이선스 문제가 있습니다:
- ASP.NET 프로젝트
- .NET Framework 버전 4.6.2 이상
Web.co/nfig 파일에 저장된 키는 제품에서 인식하거나 사용하지 않습니다.
대안
이 문제를 해결하려면 코드 내에서 ConfigurationManager를 사용하여 Web.co/nfig 파일에서 라이선스 키를 가져온 다음, 이를 License.LicenseKey 속성에 적용하는 것이 좋습니다.
예시:
<configuration>
...
<appSettings>
<add key="IronZip.LicenseKey" value="IRONZIP.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronZip.LicenseKey" value="IRONZIP.MYLICENSE.KEY.1EF01"/>
</appSettings>
...
</configuration>
위에 제공된 XML 파일을 사용하면 ConfigurationManager를 통해 라이선스 키 값을 가져와 IronZip.License.LicenseKey 속성에 전달할 수 있습니다.
using System;
using System.Co/nfiguration;
class Program
{
static void Main()
{
// Retrieve the license key from the web.co/nfig appSettings
string licenseKey = ConfigurationManager.AppSettings["IronZip.LicenseKey"];
// Apply the license key to IronZip
IronZip.License.LicenseKey = licenseKey;
// Verify that the license key is set properly
Console.WriteLine("License key applied successfully.");
}
}
using System;
using System.Co/nfiguration;
class Program
{
static void Main()
{
// Retrieve the license key from the web.co/nfig appSettings
string licenseKey = ConfigurationManager.AppSettings["IronZip.LicenseKey"];
// Apply the license key to IronZip
IronZip.License.LicenseKey = licenseKey;
// Verify that the license key is set properly
Console.WriteLine("License key applied successfully.");
}
}
Imports System
Imports System.Configuration
Module Program
Sub Main()
' Retrieve the license key from the web.config appSettings
Dim licenseKey As String = ConfigurationManager.AppSettings("IronZip.LicenseKey")
' Apply the license key to IronZip
IronZip.License.LicenseKey = licenseKey
' Verify that the license key is set properly
Console.WriteLine("License key applied successfully.")
End Sub
End Module
using System.Co/nfiguration;지시어를 사용하면Web.co/nfig와 같은 구성 파일에 액세스할 수 있습니다.ConfigurationManager.AppSettings["IronZip.LicenseKey"]는appSettings섹션에 저장된 라이선스 키를Web.co/nfig에서 가져옵니다.IronZip.License.LicenseKey = licenseKey;는 라이선스 예외를 방지하기 위해 검색된 키를 IronZIP 라이브러리에 할당합니다.Console.WriteLine()문장은 라이선스 키 신청 절차가 성공적으로 완료되었음을 개발자에게 알립니다.

