運行時複製異常
在一些罕見的情況下,這個錯誤是由於我們的特殊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
之下。 (調試是範例,請遵循您設定的配置) (如果您使用的是不同的目標框架,請更換net6.0
)2. 您會在/runtimes/
中看到所有支援的平台和操作系統作為目錄,進入適合您的目錄,然後手動將檔案複製到輸出目錄/bin/Debug/net6.0/
中。- 禁用 ML 掃描也可以防止錯誤。但是,您應該注意關閉 ML 掃描可能會使一些條碼更難檢測到,因為此功能有助於條碼檢測。
var myOptionsExample = new BarcodeReaderOptions
{
// Not using ML in scanning
ScanMode = BarcodeScanMode.OnlyBasicScan
};
var results = BarcodeReader.Read("barcode.png", myOptionsExample);
var myOptionsExample = new BarcodeReaderOptions
{
// Not using ML in scanning
ScanMode = BarcodeScanMode.OnlyBasicScan
};
var results = BarcodeReader.Read("barcode.png", myOptionsExample);
Dim myOptionsExample = New BarcodeReaderOptions With {.ScanMode = BarcodeScanMode.OnlyBasicScan}
Dim results = BarcodeReader.Read("barcode.png", myOptionsExample)