Runtimes Copy Exception

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

This error is caused in some rare cases where the DLLs for our special ML model are not copied over properly. In the solution below, you can solve this one-time error.

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/

Solution

  1. Locate the runtimes Folder: Navigate to the runtimes folder in your solution. This can be found at /bin/Debug/net6.0/runtimes (replace Debug with your current configuration and net6.0 with your target framework if it differs).

  2. Copy the Necessary Files: Within the /runtimes/ directory, you'll find subdirectories for all supported platforms and operating systems. Enter the directory that pertains to your operating system and manually copy the necessary files to the output directory: /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

    Ensure that you replace <your-platform> with the appropriate directory that matches your platform (e.g., win-x64, osx-x64, linux-x64, etc.).

  3. Rebuild and Test: After the necessary files are copied, rebuild your project to verify that the issue is resolved. The correct DLLs should now be available for the ML model to function.
Curtis Chau
技術作家

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

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

準備好開始了嗎?
Nuget 下載 47,669 | 版本: 2025.11 剛剛發布