運行時複製異常

This article was translated from English: Does it need improvement?
Translated
View the article in English

在某些罕見情況下,由於我們特殊機器學習模型的 DLL 檔案沒有正確複製,會導致此錯誤。 下面的解決方案可以解決這個一次性錯誤。

IronQrDetection.Exceptions.IronQrRuntimesCopyException:機器學習 DLL 未成功從執行時間目錄自動複製。 這種情況可能發生在各種作業系統或框架上。 請依照以下文章中的步驟解決此問題:https://ironsoftware.com/csharp/qr/troubleshooting/runtimes-copy-exception/

解決方案

1.找到runtimes資料夾: 導航到解決方案中的runtimes資料夾。 可以在/bin/Debug/net6.0/runtimes找到(如果目標框架不同,請將Debug替換為目前配置,將net6.0替換為目標框架)。

2.複製必要文件:/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/
   # 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\
   # 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-x64osx-x64linux-x64等)。

3.重建並測試: 複製必要文件後,重新建置專案以驗證問題是否已解決。 現在應該已經提供了正確的 DLL 文件,機器學習模型可以正常運作了。

柯蒂斯·週
技術撰稿人

Curtis Chau擁有卡爾頓大學電腦科學學士學位,專長於前端開發,精通Node.js、TypeScript、JavaScript和React。他熱衷於打造直覺美觀的使用者介面,喜歡使用現代框架,並擅長撰寫結構清晰、視覺效果出色的使用者手冊。

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

準備好開始了嗎?
Nuget 下載 55,860 | 版本: 2025.12 剛剛發布