運行時複製異常
在某些罕見情況下,由於我們特殊機器學習模型的 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/ # 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\請確保您已更換<your-platform>選擇與您的平台相符的對應目錄(例如, win-x64 、 osx-x64 、 linux-x64等)。
3.重建並測試: 複製必要文件後,重新建置專案以驗證問題是否已解決。 現在應該已經提供了正確的 DLL 文件,機器學習模型可以正常運作了。






