Friday, January 15, 2010

'Bad image exception" running C# code on Windows 7

We just ran into this problem with one of our tools when someone ran a C# application on Windows 7 (although it isn't supported just yet on that platform.) Turns out that the issue was related to a 64-bit Windows 7 .NET installation loading and referencing 32-bit modules. If everything used in the application was 32-bit, it would be fine; but, you can't mix and match. Since this application makes use of modules hosted by the operating system, the 64-bit modules load and the 32-bit application image tries to map the 64-bit image for usage. BLAM...

This article describes the problem:

http://www.gcn.com/Articles/2009/07/09/5-Tips-for-Developing-with-64-Bit-Windows.aspx

Looks like a recompilation is due... Great, I just love maintaining two images and builds for the same tool.

1 comment: