We have a WinForms app that runs fine on x86, but has many third-party components that make win32 calls. To get the apps to run on x64, I now compile for the x86 platform. Our habit has been to install our thick-client outside the system partition on servers, so we installed in “F:\Program Files (x86)” yesterday on a Win2003 x64 server. When run from that directory, the processes refused to exit. I tried killing them in Task Manager, taskkill, and Process Explorer, but nothing short of rebooting the server would kill those processes. When I uninstalled and reinstalled in C:\Program Files (x86), the processes exit fine.
Does the installation location really matter when running WinForms apps compiled for x86 on an x64 machine?
From my experience I can tell that it is possible to run x86 binaries on x64 systems from pretty much any location (haven’t tested if things still work if the binary is in system32, but I’m sure x86 programs can run from Program Files). I believe the Program Files / Program Files (x86) folders are just there to easily distinguish between native x64 apps and old x86 apps. From your description what you’re facing sounds much like a WoW64 compatibility issue, however if you’ve got dependencies on unmanaged code you’ll probably want to verify first if that unmanaged code runs fine and then dig deeper in what’s preventing your program from closing. Also, it would be helpful to know how are you trying to terminate the application in the first place, if it uses multiple threads or a single thread, the version of the .NET runtime that’s targeting and the version that’s installed on the server (incl. Service Pack).