A.K A.K - 20 days ago 12
C# Question

System.DllNotFoundException: Unable to load DLL 'MvxSock.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I'm trying to use the M3 API Toolkit for the first time and following the instructions at here

I'm getting the following exception in my project. I have version 9.0.4.0 according to the readme file of the zip package

When I use the MvxSockN.dll I get the following error:-


An unhandled exception of type 'System.DllNotFoundException' occurred
in WindowsFormsApplication2.exe

Additional information: Unable to load DLL 'MvxSock.dll': The
specified module could not be found. (Exception from HRESULT:
0x8007007E)


And same error but for
MvxSockx64.dll
when I use the
MvxSockN64.dll
.

This seems to be a wrapper class written for .NET which using the
MvcSock.dll
file and therefore has a dependency on it. But how I can fix this since I am unable to add that as a reference. When I try to add the
MvxSock.dll
as reference it fails with this message:


A reference to '...\MvxSock.dll' could not be added. Please make sure
that the file is accessible, and that it is a valid assembly or COM
component.


After adding all the contents on MvxAPI folder, I get the following:


An unhandled exception of type 'System.BadImageFormatException'
occurred in WindowsFormsApplication2.exe

Additional information: An attempt was made to load a program with an
incorrect format. (Exception from HRESULT: 0x8007000B)


In addition to that I have also tried different .NET frameworks. 2.0, 4.5.2. Doesn't make any difference.

Any tips on how to resolve this issue?

Many thanks,

A.K A.K
Answer

I don't understand the down vote, even though it has been discussed before but there is no single fix for this issue.

In my case, I solved the problem by

  • Initially I didn't install the API Toolkit. I was given the installed folder to copy on my machine. So I installed M3 API Toolkit from the exe installer instead.
  • Making my WCF application target 64bit platform.
  • Adding the 64 bit DLLs into the \Bin AND all the 5 dlls in C:\Windows\SysWOW64 folders.

These are the DLLs in SysWow64 folder: enter image description here

Hope this helps someone in the future.

Comments