简体   繁体   English

在类库应用程序上找不到security.dll库

[英]Unable to find security.dll library on class library application

I trying to use ssl connection on class library application but i tried to authenticate as a client to server i got following error message. 我试图在类库应用程序上使用ssl连接,但是我尝试通过身份验证作为服务器的客户端,但收到以下错误消息。

"Unable to find an entry point named 'EnumerateSecurityPackagesW' in DLL 'security.dll'." “无法在DLL'security.dll'中找到名为'EnumerateSecurityPackagesW'的入口点。”

Have any body experience about this? 有任何身体经验吗?

Security.dll is also the same name for the Windows DLL containing the SSPI implementation, which is used for authentication. Security.dll也与包含用于身份验证的SSPI实现的Windows DLL相同。 When loading DLLs, the local bin directory will be checked before the Windows directory. 加载DLL时,将在Windows目录之前检查本地bin目录。 As a result, your System.dll is being loaded instead of the SSPI System.dll. 如此一来,您的System.dll而不是SSPI System.dll被加载。

So if in certain situations your custom Security.dll is loaded before c:\\winnt\\system32\\security.dll then LoadLibrary thinks it has the dll already loaded (since it's just a Win32 Dll, only name matter, NOT version information). 因此,如果在某些情况下您的自定义Security.dll在c:\\ winnt \\ system32 \\ security.dll之前加载,则LoadLibrary认为它已经加载了该dll(因为它只是Win32 Dll,所以名称无关紧要,而不是版本信息)。 But as we know this is not the correct dll and hence the problem. 但是,正如我们所知,这不是正确的dll,因此是问题所在。

The workaround is to change the dll name. 解决方法是更改​​dll名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM