解決 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...
解決方案
- 解決此問題的方法是,首先導航至
runtimes資料夾。 在您的解決方案中,此內容將位於/bin/Debug/net6.0/runtimes之下(Debug 僅為範例,請遵循您所設定的配置)。 (If you're using a different target framework, replacenet6.0.) - 您將在
/runtimes/中看到所有受支援的平台與作業系統,請進入適用於您的目錄,並手動將檔案複製到輸出目錄/bin/Debug/net6.0/中。 - 停用 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
準備好開始了嗎?
Nuget 下載 2,230,745 | 版本: 2026.5 just released

