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

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

<i class="fa-regular fa-circle-check"@--STYLE-ATTR-99--@@> IronWebscraperのバージョン2024.3.6で、この問題は解決されました

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

以前の IronWebScraper バージョン、特にバージョン 2023.4.132024.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プロパティに渡すことができます。

// 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
$vbLabelText   $csharpLabel
カーティス・チャウ
テクニカルライター

Curtis Chauは、カールトン大学でコンピュータサイエンスの学士号を取得し、Node.js、TypeScript、JavaScript、およびReactに精通したフロントエンド開発を専門としています。直感的で美しいユーザーインターフェースを作成することに情熱を持ち、Curtisは現代のフレームワークを用いた開発や、構造の良い視覚的に魅力的なマニュアルの作成を楽しんでいます。

開発以外にも、CurtisはIoT(Internet of Things)への強い関心を持ち、ハードウェアとソフトウェアの統合方法を模索しています。余暇には、ゲームをしたりDiscordボットを作成したりして、技術に対する愛情と創造性を組み合わせています。

準備はできましたか?
Nuget ダウンロード 129,322 | バージョン: 2026.2 リリース