運行時複製異常
Curtis Chau
已更新: 2026年8月2日
在某些罕見情況下,由於我們特殊機器學習模型的 DLL 檔案沒有正確複製,會導致此錯誤。 下面的解決方案可以解決這個一次性錯誤。
IronQrDetection.Exceptions.IronQrRuntimesCopyException : Machine learning DLLs were not successfully automatically copied from the runtimes directory. This may occur on various operating systems or frameworks. Please follow the steps in the following article to resolve this issue: https://ironsoftware.com/csharp/qr/troubleshooting/runtimes-copy-exception/
Text
解決方案
-
定位
runtimes資料夾: 導覽到您方案中的runtimes資料夾。 這可以在/bin/Debug/net6.0/runtimes找到(如果有不同,將Debug替換為您當前的配置,並將net6.0替換為您的目標框架)。 -
複製必要的檔案: 在
/runtimes/目錄中,您會發現適用於所有支援平台和作業系統的子目錄。 進入與您的作業系統相關的目錄,手動將必要的檔案複製到輸出目錄:/bin/Debug/net6.0/。# Example bash command to copy files on Unix-like systems cp /bin/Debug/net6.0/runtimes/<your-platform>/* /bin/Debug/net6.0/SHELL# Example PowerShell command to copy files on Windows systems Copy-Item -Path .\bin\Debug\net6.0\runtimes\<your-platform>\* -Destination .\bin\Debug\net6.0\SHELL確保您將
<your-platform>替換為符合您平台的適當目錄(例如win-x64、osx-x64、linux-x64等)。 -
重建和測試: 複製必要文件後,重新建置專案以驗證問題是否已解決。 現在應該已經提供了正確的 DLL 文件,機器學習模型可以正常運作了。
Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。