Closed SilentCoyote closed 3 years ago
I am answering from my phone so I can't check the details, but BadImageFormatException also occurs why trying to load an x64 binary in 32 bit mode or vice versa. But loading an empty file could maybe also raise this exception.
Did compiling the native libraries work (see README)? Did the powershell script finish successfully?
Am 19. August 2021 13:54:09 MESZ schrieb SilentCoyote @.***>:
Hi,
Having cloned the github project and executed the powershell script as per the instructions for building from source on Windows, when trying to run the sample program I get a BadImageFormatException (System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (0x8007000B)') at the call to EcHL.CreateContext() in the ScanDevices method of ECUtilities.
Stack trace: at SOEM.PInvoke.EcHL.CreateContext() at EtherCAT.NET.EcUtilities.ScanDevices(String interfaceName, SlaveInfo referenceRootSlave) in D:\Projects\VisualStudio\EtherCAT.Net\src\EtherCAT.NET\EcUtilities.cs:line 290 at SampleMaster.Program.
d__0.MoveNext() in D:\Projects\VisualStudio\EtherCAT.Net\sample\SampleMaster\Program.cs:line 51 Operating system is Windows 10 x64, trying to run Debug, Any CPU build and WinPcap is installed. I've noticed the soem_wrapper.dll in artifacts\bin\SampleMaster\Debug\net50 is reporting 0KB size.
Any help would be appreciated!
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/Apollo3zehn/EtherCAT.NET/issues/65
I got an hint that the Nuget package is also not working and containing a 0 kB file. I will check the build process tomorrow morning.
Should be fixed now (nuget package and all branches). I´ll close this for now. If the problem persists, please tell me.
Hi,
Having cloned the github project and executed the powershell script as per the instructions for building from source on Windows, when trying to run the sample program I get a BadImageFormatException (System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (0x8007000B)') at the call to EcHL.CreateContext() in the ScanDevices method of ECUtilities.
Stack trace: at SOEM.PInvoke.EcHL.CreateContext() at EtherCAT.NET.EcUtilities.ScanDevices(String interfaceName, SlaveInfo referenceRootSlave) in D:\Projects\VisualStudio\EtherCAT.Net\src\EtherCAT.NET\EcUtilities.cs:line 290 at SampleMaster.Program.d__0.MoveNext() in D:\Projects\VisualStudio\EtherCAT.Net\sample\SampleMaster\Program.cs:line 51
Operating system is Windows 10 x64, trying to run Debug, Any CPU build and WinPcap is installed. I've noticed the soem_wrapper.dll in artifacts\bin\SampleMaster\Debug\net50 is reporting 0KB size.
Any help would be appreciated!