解決 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);
$vbLabelText   $csharpLabel
柯蒂斯·週
技術撰稿人

Curtis Chau擁有卡爾頓大學電腦科學學士學位,專長於前端開發,精通Node.js、TypeScript、JavaScript和React。他熱衷於打造直覺美觀的使用者介面,喜歡使用現代框架,並擅長撰寫結構清晰、視覺效果出色的使用者手冊。

除了開發工作之外,柯蒂斯對物聯網 (IoT) 也抱有濃厚的興趣,致力於探索硬體和軟體整合的創新方法。閒暇時,他喜歡玩遊戲和製作 Discord 機器人,將他對科技的熱愛與創造力結合。

準備好開始了嗎?
Nuget 下載 2,035,202 | 版本: 2025.12 剛剛發布