Resolve Runtime Copy Exceptions in IronBarcode

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

このエラーは、特殊なMLモデルのDLLが正しくコピーされていないまれなケースで発生します。 以下の解決策で、この一度きりのエラーを解決できます。

Machine learning DLLs were not successfully automatically copied from the runtimes directory. This may occur on various operating systems or frameworks...

解決策

  1. この問題の解決策は、まずruntimesフォルダーに移動することです。 あなたのソリューションでは、これは/bin/Debug/net6.0/runtimes(Debugは例であり、設定された構成に従ってください)(異なるターゲットフレームワークを使用している場合は、net6.0を置き換えてください。)にあります。
  2. /runtimes/内にサポートされているすべてのプラットフォームとオペレーティングシステムがディレクトリとして表示されます。自分に当てはまるものに入り、ファイルを手動で出力ディレクトリ/bin/Debug/net6.0/にコピーしてください。
  3. MLスキャンの無効化もエラーを防ぐことができます。 しかし、MLスキャンをオフにすると、いくつかのバーコードの検出が困難になる場合があります。この機能はバーコードの検出を助けるからです。
// Define scanning options, disabling machine learning for basic scan only
var myOptionsExample = new BarcodeReaderOptions
{
    // ScanMode is set to only use the basic scan, without ML-enhanced features
    ScanMode = BarcodeScanMode.OnlyBasicScan
};

// Perform barcode reading with the specified options
var results = BarcodeReader.Read("barcode.png", myOptionsExample);
// Define scanning options, disabling machine learning for basic scan only
var myOptionsExample = new BarcodeReaderOptions
{
    // ScanMode is set to only use the basic scan, without ML-enhanced features
    ScanMode = BarcodeScanMode.OnlyBasicScan
};

// Perform barcode reading with the specified options
var results = BarcodeReader.Read("barcode.png", myOptionsExample);
' Define scanning options, disabling machine learning for basic scan only
Dim myOptionsExample = New BarcodeReaderOptions With {.ScanMode = BarcodeScanMode.OnlyBasicScan}

' Perform barcode reading with the specified options
Dim results = BarcodeReader.Read("barcode.png", myOptionsExample)
$vbLabelText   $csharpLabel
Curtis Chau
テクニカルライター

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

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

準備はいいですか?
Nuget ダウンロード 1,935,276 | バージョン: 2025.11 ただ今リリースされました