64 bit vs 32 bit

ideprize

Well-known member
Joined
Oct 19, 2011
Messages
97
Programming Experience
10+
Hi All

I have a vb.net application that I have radically modified. Upon installing it last night I discovered that it runs correctly from a 32 bit Windows system but when I attempt to run it from a 64 bit Windows system I get the "incorrect format" error. I am using the "any pc" option in the compile setup so what am I missing. My development platform is vs 2005. Any insights would be greatly appreciated.

Respectfully,
Ideprize
 
Are you using any libraries that are 32-bit only, e.g. COM components? If that's the case then you must target the x86 platform to run in a 32-bit process on all systems.
 
Hi JM
As always you have again saved the day. I am using codebase to provide db interface between the vb.net program and FoxPro tables and this is a 32 bit system. I was thinking that by selecting the "any pc" option this would compensate for the 32 bit architecture - sort of a bridge builder. Now I wonder why is the option there at all? If you need to build to x86 when you have 32 bit modules which then lets you run on either platform and assuming the corollary holds true with the x64 option what does the any pc option "provide"? Anyway after changing the option to x86 and recompiling/rebuilding the program did indeed load without incident. Again JM - thanks!
Respectfully,
Ideprize
 
If you target the x86 platform then your app will always run in a 32-bit process, regardless of whether it's on a 32-bit or 64-bit system. If you target the x64 platform then your app will always run in a 64-bit process, which means that it will only run on a 64-bit system. If you target Any CPU then your app will run in a 32-bit process on 32-bit systems and in a 64-bit process on 64-bit systems. If you have no need to use 32-bit libraries then it's preferable to run in a 64-bit process on a 64-bit system, hence the Any CPU platform is what you should target in that case.
 
Back
Top