解決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只是個例子,請根據您設定的Configuration進行操作)。 (If you're using a different target framework, replace net6.0.)
  2. /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擁有Carleton大學的電腦科學學士學位,專精於前端開發,擁有Node.js、TypeScript、JavaScript和React的專業知識。Curtis熱衷於建立直觀且美觀的使用者介面,喜愛使用現代框架並建立結構良好、視覺吸引力的手冊。

除了開發,Curtis對物聯網(IoT)有濃厚的興趣,探索創新的方法來整合硬體和軟體。在空閒時間,他喜歡玩遊戲和建立Discord機器人,結合他對技術的熱愛與創造力。

準備好開始了嗎?
Nuget 下載 2,331,688 | 版本: 2026.7 剛剛發布
Still Scrolling Icon

還在滾動嗎?

想快速驗證嗎? PM > Install-Package BarCode
運行範例觀看您的字串成為條碼。