web.co/nfig における IronBarcode のライセンス設定

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

この問題は、IronBarcodeの2024.3.2バージョンで解決されました。

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

IronBarcodeの旧バージョン、具体的にはバージョン2023.4.1から2024.3.2の間において、以下の点で既知のライセンス上の問題があります:

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

Web.co/nfig ファイルに保存されたキーは、本製品によって取得・使用されることはありません

回避策

この問題に対処するには、コード内でConfigurationManagerを使用してLicense.LicenseKeyプロパティに適用することを推奨します。

例:

<configuration>
  ...
  <appSettings>
    <add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
  </appSettings>
  ...
</configuration>
<configuration>
  ...
  <appSettings>
    <add key="IronBarCode.LicenseKey" value="IRONBARCODE-MYLICENSE-KEY-1EF01"/>
  </appSettings>
  ...
</configuration>
XML

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

using System.Co/nfiguration;
// Retrieve the license key from appSettings in the Web.co/nfig file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];

// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;
using System.Co/nfiguration;
// Retrieve the license key from appSettings in the Web.co/nfig file
string licenseKey = ConfigurationManager.AppSettings["IronBarCode.LicenseKey"];

// Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey;
Imports System.Configuration

' Retrieve the license key from appSettings in the Web.config file
Dim licenseKey As String = ConfigurationManager.AppSettings("IronBarCode.LicenseKey")

' Apply the retrieved license key to the IronBarCode LicenseKey property
IronBarCode.License.LicenseKey = licenseKey
$vbLabelText   $csharpLabel
カーティス・チャウ
テクニカルライター

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

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

準備はできましたか?
Nuget ダウンロード 2,240,258 | バージョン: 2026.5 just released
Still Scrolling Icon

まだスクロールしていますか?

すぐに証拠が欲しいですか? PM > Install-Package BarCode
サンプルを実行する 文字列が BarCode になるのを見る。