运行时复制异常
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/
解决方案
- 定位
runtimes文件夹: 在您的解决方案中导航到runtimes文件夹。 这可以在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
请确保用与您的平台相匹配的适当目录替换
linux-x64等)。
3.重建并测试: 复制必要文件后,重新构建项目以验证问题是否已解决。 现在应该已经提供了正确的 DLL 文件,机器学习模型可以正常运行了。
准备开始了吗?
Nuget 下载 70,398 | 版本: 2026.7 刚刚发布

