I can not run an application in x86 debug mode

0

I'm having problems in my application, because when I compile in debug anycpu, it runs perfectly, but when I compile in x86 debug it has the following error:

  

System.BadImageFormatException: 'An attempt has been made to   load a program with an incorrect format. (Exception from HRESULT:   0x8007000B).

Soon after I was able to compile in x86 debug and exported the application to install it on another machine for testing 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.
    
asked by anonymous 12.09.2017 / 16:28

1 answer

1

It is possible to solve this problem by loading the dll correct for the environment, it has to be compatible with what is running, being 32Bits or 64Bits.

    
12.09.2017 / 22:18