我正在尝试在 中使用 crypto++ c++ clr类库 .
问题是我在运行应用程序时遇到错误,但它构建成功。
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'auth.dll' or one of its dependencies. A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A)
at ConsoleApp52.Program.Main(String[] args)
仅当我包含来自 crypto++ 的任何内容时才会发生此错误
#include "dll.h"
#include "sha.h"
#include "filters.h"
#include "hex.h"
如果我删除以下行,它会起作用。
我尝试将 cryptopp.dll 复制到 bin/x64/Debug 和 bin/Debug 中,但没有解决问题。
我还需要包括什么?我错过了什么吗?
依赖:
最佳答案
错误代码 0x8007045A
通常意味着 32/64 位 DLL 不兼容。
如果您将 native DLL 与托管代码一起使用,请确保在 64 位操作系统上使用 64 位版本。
关于c# - 如何确保可以加载 auth.dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60113390/