解決 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 僅為範例,請遵循您所設定的配置)。 (If you're using a different target framework, replace net6.0.)
  2. 您將在 /runtimes/ 中看到所有受支援的平台與作業系統,請進入適用於您的目錄,並手動將檔案複製到輸出目錄 /bin/Debug/net6.0/ 中。
  3. 停用 ML 掃描功能亦可避免此錯誤。 不過,請注意,若關閉機器學習掃描功能,可能會導致部分 BarCode 較難被偵測,因為此功能有助於 BarCode 偵測。
// 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 擁有卡爾頓大學(Carleton University)的電腦科學學士學位,專精於前端開發,並精通 Node.js、TypeScript、JavaScript 及 React。他熱衷於打造直觀且美觀的用戶介面,喜歡運用現代框架,並創建結構完善、視覺上吸引人的手冊。

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

準備好開始了嗎?
Nuget 下載 2,230,745 | 版本: 2026.5 just released
Still Scrolling Icon

還在捲動嗎?

想要快速證明? PM > Install-Package BarCode
執行範例 看您的字串變成 BarCode。