IronWebScraper ライセンスキー for ASP.NET

This article was translated from English: Does it need improvement?
Translated
View the article in English

問題は IronWebScraper バージョン 2024.3.6 にて解決されました。

Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWebScraper must be licensed for development.
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWebScraper must be licensed for development.
SHELL

古いIronWebScraperバージョン、特に2023.4.13から2024.3.6の間のバージョンには、以下のライセンスに関する既知の問題があります。

  • ASP.NET プロジェクト
  • .NET Framework バージョン >= 4.6.2

    Web.config ファイルに保存されたキーは、製品によって使用されません

ワークアラウンド

この問題に対処するには、Web.configファイルからConfigurationManagerを使用してライセンスキーを取得し、それをLicense.LicenseKeyプロパティに適用することをお勧めします。

例:

<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>
XML

上記で提供されたXMLファイルを使用して、ConfigurationManagerを使用してライセンスキーの値を取得し、それをIronWebScraper.License.LicenseKeyプロパティに渡すことができます。

using System.Configuration;

string licenseKey = ConfigurationManager.AppSettings ["IronWebScraper.LicenseKey"];

IronWebScraper.License.LicenseKey = licenseKey;
using System.Configuration;

string licenseKey = ConfigurationManager.AppSettings ["IronWebScraper.LicenseKey"];

IronWebScraper.License.LicenseKey = licenseKey;
Imports System.Configuration

Private licenseKey As String = ConfigurationManager.AppSettings ("IronWebScraper.LicenseKey")

IronWebScraper.License.LicenseKey = licenseKey
$vbLabelText   $csharpLabel