Klucz licencyjny IronWebscraper dla ASP.NET
Problem został rozwiązany od wersji IronWebscraper 2024.3.6.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWebScraper must be licensed for development.
Dla starszych wersji IronWebscraper, zwłaszcza tych między wersjami 2023.4.13 a 2024.3.6, występuje znany problem z licencjonowaniem w:
- projektach ASP.NET
- wersjach .NET Framework >= 4.6.2
Klucz przechowywany w pliku Web.config NIE zostanie wykryty i użyty przez produkt.
Obejście
Aby rozwiązać ten problem, zaleca się pobranie klucza licencyjnego z pliku Web.config za pomocą ConfigurationManager w kodzie, a następnie zastosowanie go w właściwości License.LicenseKey.
Przykład:
<configuration>
...
<appSettings>
<add key="IronWebScraper.LicenseKey" value="IRONWEBSCRAPER-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
<configuration>
...
<appSettings>
<add key="IronWebScraper.LicenseKey" value="IRONWEBSCRAPER-MYLICENSE-KEY-1EF01"/>
</appSettings>
...
</configuration>
Za pomocą dostarczonego powyżej pliku XML możemy użyć ConfigurationManager, aby pobrać wartość klucza licencyjnego i przekazać ją do właściwości IronWebScraper.License.LicenseKey.
// Retrieve the license key from the appSettings section of the Web.config file.
string licenseKey = ConfigurationManager.AppSettings["IronWebScraper.LicenseKey"];
// Assign the license key to the IronWebScraper's LicenseKey property.
IronWebScraper.License.LicenseKey = licenseKey;
// Retrieve the license key from the appSettings section of the Web.config file.
string licenseKey = ConfigurationManager.AppSettings["IronWebScraper.LicenseKey"];
// Assign the license key to the IronWebScraper's LicenseKey property.
IronWebScraper.License.LicenseKey = licenseKey;
' Retrieve the license key from the appSettings section of the Web.config file.
Dim licenseKey As String = ConfigurationManager.AppSettings("IronWebScraper.LicenseKey")
' Assign the license key to the IronWebScraper's LicenseKey property.
IronWebScraper.License.LicenseKey = licenseKey

