解決 IronBarcode 中的運行時複製異常

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 是一個範例,請按照您設定的配置進行操作)(如果您使用的是不同的目標框架,請取代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) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。

準備好開始了嗎?
Nuget 下載 1,979,979 | Version: 2025.11 剛發表