Wiki
Version 1 (modified by Chuck, 8 years ago)

--

Troubleshooting

Here are some problems people run into when getting started with Cobra and their solution.

64-bit vs. 32-bit Clash

Symptoms include a "BadImageFormatException". You might be running on a 64-bit operating system, but trying to use a DLL/library that is 32-bit native. In other words, you're using a C or C++ library built for 32-bit on a 64-bit system.

The solution is to build against the "x86" platform, instead of "x64" or "Any". Note that "Any" is the default, and will run in whatever is native to the machine such as 32-bit or 64-bit. You can target "x86" at the command line:

cobra -sharp-args:"/platform:x86" ...

or with a directive in a source file:

@args -sharp-args:"/platform:x86"

Also note that you can "cd C:\Windows\Microsoft.NET\Framework64\v2.0.50727" and then enter "ldr64 setwow" to force .NET programs to run as 32-bit. You can enter "ldr64 set64" to switch back.