编辑(整个问题,太不清楚了)
我想使用 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.dll
和 ssleay32.dll
放入我的 bin/Debug
和 bin/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/