Make a C # program to compile on any operating system

I started creating a C # program on XP 32-bit Windows operating system in C # 2008, and now I try to open it on a 64-bit Windows 7 operating system. There is a problem: I can not run the program in C # 2010 on my 64 -bit system, and it will not pass by Initialize Component (); line in my code. It arrives with an error: "BadImageFormatException was unhandled", which, I think, is caused by a change in the system where I open it. Any help in this we will be brilliant.

thanks

+4
source share
3 answers

The problem you are facing is that you compiled the application with any processor. Change it to x86 and recompile.

Most likely you have a library that x86 depends on. Since your application is compiled like any processor, the Win7 x64 system loads it as a 64-bit application ... and does not work when loading a 32-bit library.

+8
source

In Build-> Configuration Manager, is your platform installed on “Any processor” for each project?

+1
source

What is your build profile configured on AnyCPU, x86 or x64, of course, the program compiles on a new machine.

I assume that you have all the updates for .NET and Visual Studio on each computer, right?

0
source

All Articles