You may receive an unhandled exception error called System.BadImageFormatException in CHM_CSHARP.dll when trying to run a Chameleon application in 64-bit Windows 2003 Server. This error only affects applications built with C# and VB.NET.
To fix this issue, there are two options:
Option
Description
1
Run your application in a 32-bit version of Windows.
2
Run your application inside Windows-on-Windows 64-bit (WoW64).
WoW64 (Windows-on-Windows 64-bit) is a subsystem of the Windows operating system that is capable of running 32-bit applications. It is shipped with all 64-bit versions of Windows.
To force your application to run in WoW64:
Navigate to the Project Properties in Visual Studio.
Select the Build tab.
Set the Platform Target to x86, as shown below. Note that the screens and steps may vary if you are using Visual Studio 2003 or VB.NET.
Setting the Platform Target to x86 in Visual Studio 2005
Re-compile your application, and try running it again inside WoW64. The error should now be resolved.