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

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

问题描述

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

我想使用 OpenSSL.NET

OpenSSL.NET 安装说明页面:安装

<块引用>

确保您在当前工作中有 libeay32.dll 和 ssleay32.dll应用程序目录或 PATH.完成
在您的 .NET 项目中,添加对 ManagedOpenSsl.dll 程序集的引用.完成

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

这是我的完整代码:

使用系统;命名空间 ConsoleApplication1{课程计划{静态无效主(字符串 [] args){尝试{OpenSSL.Crypto.RSA rsa = 新的 OpenSSL.Crypto.RSA();}捕获(例外 e){Console.WriteLine(e.InnerException.Message);}Console.Read();}}}

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

这是进程监视器日志(应要求提供):替代文本 http://localhostr.com/files/726a46/ProcMon.gif>

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

解决方案

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

EDIT (the whole question, it was too unclear)

I want to use OpenSSL.NET

The OpenSSL.NET install instructions page: 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

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

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

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

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

What am I doing wrong? Why isn't the DLL found?

解决方案

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天全站免登陆