運行時複製異常

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> 替換為您的平台對應的目錄(例如,linux-x64 等)。

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

Curtis Chau
技術作家

Curtis Chau 擁有卡爾頓大學計算機科學學士學位,專注於前端開發,擅長於 Node.js、TypeScript、JavaScript 和 React。Curtis 熱衷於創建直觀且美觀的用戶界面,喜歡使用現代框架並打造結構良好、視覺吸引人的手冊。

除了開發之外,Curtis 對物聯網 (IoT) 有著濃厚的興趣,探索將硬體和軟體結合的創新方式。在閒暇時間,他喜愛遊戲並構建 Discord 機器人,結合科技與創意的樂趣。

準備好開始了嗎?
Nuget 下載 61,359 | 版本: 2026.3 剛剛發布
Still Scrolling Icon

還在捲動嗎?

想要快速證明? PM > Install-Package IronQR
執行範例 觀看您的 URL 變成 QR code。