c# - 为什么 .NET 找不到 OpenSSL.NET dll?

标签 c# .net dll dllimport dllnotfoundexception

编辑(整个问题,太不清楚了)

我想使用 OpenSSL.NET

OpenSSL.NET 安装说明页面:INSTALL

Make sure you have libeay32.dll and ssleay32.dll in the current working directory of your application or in your PATH. DONE
In your .NET project, add a reference to the ManagedOpenSsl.dll assembly. DONE

我已将 libeay32.dllssleay32.dll 放入我的 bin/Debugbin/Release 目录。我还把它们放在 system32 中。

这是我的完整代码:

using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                OpenSSL.Crypto.RSA rsa = new OpenSSL.Crypto.RSA();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.InnerException.Message);
            }
            Console.Read();
        }
    }
}

我收到以下错误: Unable to load DLL 'libeay32' http://localhostr.com/files/a719c5/Error.gif (无法加载 DLL 'libeay32')

这是 Process Monitor 日志(根据要求): alt text http://localhostr.com/files/726a46/ProcMon.gif

我做错了什么?为什么找不到 DLL?

最佳答案

尝试最新版本的 OpenSSL.NET ( 0.4.1 ),它现在应该包括静态链接到 CRT 的预构建 libeay32.dll 和 ssleay32.dll 二进制文件。或者,您可以自己构建这些库或使用来自 openssl.org 的“官方”构建。

关于c# - 为什么 .NET 找不到 OpenSSL.NET dll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1396164/

相关文章:

C#-C进程间通信

c# - : this(foo) syntax in C# constructors?

c# - 如何在 WinForms 中绘制图像反射?

C# 重新抛出异常 : how to get the exception stack in the IDE?

winapi - Websphere MQ C++ 客户端在 VS2013 中崩溃-库/链接器问题?

dll 没有有效的 clr header ,无法反汇编

c# - system.linq.strings 由于其保护级别而无法访问

c# - 何时需要dispose()的规则是什么?

c++ - D3D->CreateDevice() 在注入(inject)的 DLL 中失败

C# - 从现有字典创建列表