How to load in Powershell a DLL that is missing a manifest

2

These lines:

"[Environment]::Is64BitProcess"

"[Reflection.Assembly]::LoadFile("C:\MvxAPI\MvxSockx64.dll") "

gives these results:

True

Exception calling "LoadFile" with "1" argument(s): "The module was expected to contain an assembly manifest. (Exception from HRESULT: 0x80131018)" At C:\GitRepo\PowerShellScripts\ApiDllTest.ps1:11 char:1 + [Reflection.Assembly]::LoadFile("C:\MvxAPI\MvxSockx64.dll") + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : BadImageFormatException

The DLL is supplied by the ERP manufacture (Infor M3) and I'm trying to use it to send transactions to the ERP from a PowerShell program I've created. Since I'm not a system admin but instead just a nerd that supports the ERP, I'm actually clueless as to what I'm doing related to the DLL. Google has gotten me this far but i can't get beyond this error. The same error returns when I attempt to use the non x64 version.

Thanks for your wisdom. All suggestions are appreciated.

powershell
dll
asked on Stack Overflow Dec 6, 2017 by RickInGarland

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0