Click here to Skip to main content
13,006,319 members (58,325 online)
Rate this:
Please Sign up or sign in to vote.
Hi everyone!

How can I target my deployment for 32-bit or 64-bit computers? My program works just fine on a 64 bit computer, but when I try to run it on a 32-bit computer, it fails on startup after double clicking the exe icon. I can't tell where the root is, whether it be with Visual Studio or InstallShield.
Posted 31-Oct-12 11:01am
Sergey Alexandrovich Kryukov 31-Oct-12 20:06pm
There can be different reasons for that. Did you try to target it to "AnyCPU", which is the most reasonable target in most cases?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Your application is likely built as a 64 bit application in which case it will only run on a 64 bit system. If you need it to run in both 32 and 64 bit, then you'll have to target your solution in Visual Studio to 32 bit and the compiled application should work in both environments provided no dependencies exist that are only 64 bit.
joshrduncan2012 31-Oct-12 17:11pm
How can I change it to 32 bit? Is that in Config Manager? Also, how do I know whether or not the sql server compact dlls are 32 bit or 64 bit?
Marcus Kramer 31-Oct-12 17:17pm
Project Properties->Build Tab-> Platform Target: x86
If your solution builds and runs properly after changing the target, then you're ok on the 32/64 bit stuff. My personal preference is to select "Any CPU" in cases like this.
Sergey Alexandrovich Kryukov 31-Oct-12 20:12pm
Marcus, it should not be just your personal preference, as this is the only reasonable target for almost all cases. You should have mentioned this first in the answer itself. Concrete CPU instruction-set architectures should be set only for special cases, such as the cases of P/Invoked unmanaged code by one of assembly.
It's also important to know that it's absolutely impossible to mix two different target architectures in one process. And the resulting architecture is mandated ether by the entry assembly, or by physical CPU in case of "AnyCPU". And also, both 64-bits are compatible with 32-bit executed via WoW64, but not with each other.
(I voted 4 this time.)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170628.1 | Last Updated 31 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100