c# - 如何确保可以加载 auth.dll?

标签 c# c++ clr crypto++

我正在尝试在 中使用 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 中,但没有解决问题。
我还需要包括什么?我错过了什么吗?

依赖:
dependencies

libs

build

solution

最佳答案

错误代码 0x8007045A通常意味着 32/64 位 DLL 不兼容。

如果您将 native DLL 与托管代码一起使用,请确保在 64 位操作系统上使用 64 位版本。

关于c# - 如何确保可以加载 auth.dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60113390/

相关文章:

c# - String.Split 能否区分 char 的单个实例和多个实例?

c++ - 如何使用 Opengl 库显示文本文件中的 3D 点

c++ - 开始使用 OpenNI 编写 Kinect 应用程序

c++ - 如何使用boost序列化轻松序列化包含另一个自定义类的STL容器的自定义类?

c# - 使用与结构相关的 ref 会导致它存储在堆上吗?

c# - 来自动态代码的异常堆栈跟踪中的文件路径和行号错误

c# - 在ssis脚本组件中添加第三方dll引用

c# - 该代码是否有潜在危险?

asp.net - 遇到访问冲突时,w3wp.exe 崩溃并反复重新启动,直到应用程序池停止

c# - 为什么调用 Dispose?