0
I’m having problems in my application, because when I compile in anycpu debug, it runs perfectly, but when I compile in x86 debug it presents the following error:
System.Badimageformatexception: 'An attempt has been made to load a program with an incorrect format. (Exception of HRESULT: 0x8007000B).
Soon after I was able to compile in x86 debug and exported the application to install it on another machine to test and the error continued, but a report with more error information appeared:
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text ************** System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at EZClientCSharp.EZInterface.TestConnection() at EZClientCSharp.Form1.ReadPumpsStatus() at EZClientCSharp.Form1.timerAppLoop_Tick(Object sender, EventArgs e) at System.Windows.Forms.Timer.OnTick(EventArgs e) at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies ************** mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- EZClientCSharp Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Users/Eztech-Teste/AppData/Local/Apps/2.0/R8Y36OTB.RYR/K54ZCLR3.HV2/ezcl..tion_7801d6183abab3fc_0001.0000_cf0a8c3c24228d3d/EZClientCSharp.exe ---------------------------------------- System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400) CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled. For example: <configuration> <system.windows.forms jitDebugging="true" /> </configuration> When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.
Running without debugging (Ctrl + F5) works?
– Alexandre Cavaloti
No. Same mistake.
– Diego Aquino
includes JIT debug setup in app.config to try to get a better look at which routine/function/code is causing the error:
<configuration>
 <system.windows.forms jitDebugging="true" />
</configuration>
– Alexandre Cavaloti
I went through this problem and in MY case was DLL version, it has to be compatible with what is running, being 32bits or 64bits.
– LP. Gonçalves
Thanks, guys. I managed to resolve with the hint of LP. Gonçalves. It was the dll version. Hugs.
– Diego Aquino