IronBarcodeでのランタイムコピー例外の解決

2023年10月5日
更新済み 2024年10月20日
共有:
This article was translated from English: Does it need improvement?
Translated
View the article in English

このエラーは、特殊な機械学習モデルの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は例ですので、設定したConfigurationに従ってください)(別のターゲットフレームワークを使用している場合は、net6.0を置き換えてください)。

  2. すべてのサポートされているプラットフォームとオペレーティングシステムが/runtimes/ディレクトリに表示されます。自分に該当するものに移動し、ファイルを手動で出力用ディレクトリ/bin/Debug/net6.0/にコピーしてください。

  3. MLスキャンを無効にすることで、このエラーを防ぐこともできます。 ただし、MLスキャンをオフにすると、バーコードの検出が難しくなる場合があります。この機能はバーコードの検出を助けるためです。
var myOptionsExample = new BarcodeReaderOptions
{
    // Not using ML in scanning
    ScanMode = BarcodeScanMode.OnlyBasicScan
};

var results = BarcodeReader.Read("barcode.png", myOptionsExample);
var myOptionsExample = new BarcodeReaderOptions
{
    // Not using ML in scanning
    ScanMode = BarcodeScanMode.OnlyBasicScan
};

var results = BarcodeReader.Read("barcode.png", myOptionsExample);
Dim myOptionsExample = New BarcodeReaderOptions With {.ScanMode = BarcodeScanMode.OnlyBasicScan}

Dim results = BarcodeReader.Read("barcode.png", myOptionsExample)
$vbLabelText   $csharpLabel