執行階段複製例外

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

此錯誤發生於極少數情況下,即我們專用 ML 模型的 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. 重新建置與測試: 複製完畢後,請重新建置專案以確認問題已解決。 現在,ML 模型應已具備正確的 DLL 檔案以供運作。
Curtis Chau
技術撰稿人

Curtis Chau 擁有卡爾頓大學(Carleton University)的電腦科學學士學位,專精於前端開發,並精通 Node.js、TypeScript、JavaScript 及 React。他熱衷於打造直觀且美觀的用戶介面,喜歡運用現代框架,並創建結構完善、視覺上吸引人的手冊。

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

準備開始了嗎?
Nuget 下載 67,270 | 版本: 2026.5 just released
Still Scrolling Icon

還在往下捲動嗎?

想要快速確認成果嗎? PM > Install-Package IronQR
執行範例 觀看您的 URL 轉為 QR 碼。