运行时复制异常

Curtis Chau
Curtis Chau
更新: 2026年8月2日

在某些罕见情况下,由于我们特殊机器学习模型的 DLL 文件没有正确复制,会导致此错误。 下面的解决方案可以解决这个一次性错误。

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/
Text

解决方案

  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/
    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\
    SHELL

    请确保将<your-platform>替换为适合您平台的目录(例如,win-x64,osx-x64,linux-x64等)。

  3. 重建并测试: 复制必要文件后,重新构建项目以验证问题是否已解决。 现在应该已经提供了正确的 DLL 文件,机器学习模型可以正常运行了。

Curtis Chau 拥有卡尔顿大学的计算机科学学士学位,专注于前端开发,精通 Node.js、TypeScript、JavaScript 和 React。他热衷于打造直观且美观的用户界面,喜欢使用现代框架并创建结构良好、视觉吸引力强的手册。

阅读更多

准备开始了吗?

NuGet 下载量 82,442版本:2026.11刚刚发布