ASP.NET 用 IronWebScraper ライセンスキー
この問題は、IronWebScraper バージョン2024.3.6で解決されました。
Exception: Unhandled exception. IronSoftware.Exceptions.LicensingException: IronWebScraper must be licensed for development.
以前の IronWebScraper バージョン、特にバージョン 2023.4.13 と 2024.3.6 の間に、ライセンスに関する既知の問題があります。
- ASP.NETプロジェクト
- .NET Frameworkバージョン >= 4.6.2
Web.config ファイルに保存されたキーは、製品によって取得および使用されません。
回避策
この問題に対処するには、コード内でConfigurationManagerを使用して Web.config ファイルからライセンス キーを取得し、それを 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ファイルを使用すると、ConfigurationManagerを使ってライセンスキーの値を取得し、それを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

