Question

I have started making a C# program on a XP 32bit windows operating system in c# 2008, and now i am trying to open it in Windows 7 64bit operating system. The problem that arises is that i can't run the program in c# 2010 on my 64bit system and it won't go past the Initialize Component(); line in my code. It comes up with an error of, "BadImageFormatException was unhandled" which i think is because of the system change of where i am opening it. Any help on this we be brilliant.

Thanks

Was it helpful?

Solution

The problem you are faced with is that you have compiled the app with Any CPU. Change it to x86 and recompile.

Most likely you have a library you are dependent on which is x86. Because your app is compiled as Any CPU, the Win7 x64 system is loading it as a 64bit app... and failing when trying to load the 32 bit library.

OTHER TIPS

In Build->Configuration Manager, is your Platform set to "Any CPU" for each project?

What is your build profile set to AnyCPU, x86, or x64 there is of course compiling the program on the new machine.

I assume you have all the updates to .NET and Visual Studio on each computer, correct?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top