| 1 | == Troubleshooting == |
| 2 | |
| 3 | Here are some problems people run into when getting started with Cobra and their solution. |
| 4 | |
| 5 | === 64-bit vs. 32-bit Clash === |
| 6 | |
| 7 | 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. |
| 8 | |
| 9 | 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: |
| 10 | {{{ |
| 11 | cobra -sharp-args:"/platform:x86" ... |
| 12 | }}} |
| 13 | or with a directive in a source file: |
| 14 | {{{ |
| 15 | @args -sharp-args:"/platform:x86" |
| 16 | }}} |
| 17 | |
| 18 | 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. |
| 19 | |