为什么.NET找不到OpenSSL.NET DLL? [英] Why doesn't .NET find the OpenSSL.NET dll?

查看:176
本文介绍了为什么.NET找不到OpenSSL.NET DLL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑(整个问题,这是不太清楚的)

EDIT (the whole question, it was too unclear)

我想使用 OpenSSL.NET

OpenSSL.NET安装说明页面: INSTALL

The OpenSSL.NET install instructions page: INSTALL


确保你有libeay32 .dll和ssleay32.dll在当前工作的
目录中的应用程序或您的PATH。 DONE

在您的.NET项目中,添加对ManagedOpenSsl.dll程序集的引用。 DONE

我把 libeay32.dll ssleay32.dll 在我的 bin / Debug bin / Release 目录。我也把它们放在 system32 中。

I have put libeay32.dll and ssleay32.dll in both my bin/Debug and bin/Release directories. I have also put them in system32.

这是我的全部代码: / p>

Here is my FULL code:

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();
        }
    }
}

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

I get the following error: Unable to load DLL 'libeay32' http://localhostr.com/files/a719c5/Error.gif (Unable to load DLL 'libeay32')

这是进程监视器日志(根据要求):
alt text http://localhostr.com/files/726a46/ProcMon.gif

Here is the Process Monitor log (upon request): alt text http://localhostr.com/files/726a46/ProcMon.gif

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

推荐答案

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

Try the latest version of OpenSSL.NET (0.4.1) which should now include prebuilt libeay32.dll and ssleay32.dll binaries that link to the CRT statically. Alternatively, you can build these libraries yourself or use an 'official' build from openssl.org.

这篇关于为什么.NET找不到OpenSSL.NET DLL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆