Why doesn't .NET find the OpenSSL.NET dll?

前端 未结 12 1058
无人及你
无人及你 2020-12-10 05:57

EDIT (the whole question, it was too unclear)

I want to use OpenSSL.NET

The OpenSSL.NET install instructions page: INSTALL

12条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-10 06:45

    Without looking at your code exactly, I get that error when I:

    • do not have the dlls in the path of the executable (not where your sln resides, but where the .exe is made, typically in bin/debug or bin/x86/debug or whatever).
    • do not have the proper signature of the calling function (ie, I left out an integer parameter, the return types don't match, etc).
    • am not marshalling the types properly (ie, BOOL is marshalled as a bool, while bool is marshalled as a unsigned single byte integer, etc)-- while this last one may not cause the exception, it can cause decidedly funky behavior.
    • am on a 64 bit platform and am calling a 32 bit dll. The pointer sizes will be all different, and the dll will probably just crash and cause that exception.

    EDIT: When all else fails, try dependency walker, because it sounds like your dlls are calling other dlls that aren't in your path or in the directory of the executable.

提交回复
热议问题