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...
解決策
- この問題の解決策は、まず
runtimesフォルダに移動することです。 ソリューション内では、これは/bin/Debug/net6.0/runtimesの下に配置されます(Debug は一例です。設定した構成に従ってください)。 (If you're using a different target framework, replacenet6.0.) - サポートされているすべてのプラットフォームとオペレーティングシステムが
/runtimes/内のディレクトリとして表示されます。該当するディレクトリに移動し、ファイルを手動で出力先の/bin/Debug/net6.0/ディレクトリにコピーしてください。 - 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
準備はできましたか?
Nuget ダウンロード 2,240,258 | バージョン: 2026.5 just released

