We help IT Professionals succeed at work.

32-bit C# program won't run on Vista 64-bit

rmmarsh
rmmarsh asked
on
Medium Priority
1,358 Views
Last Modified: 2012-08-14
I have a C# program written using VS 2008 Express edition on a XP 32-bit machine.  When my Vista 64-bit users try to run the program, it crashes before even displaying the splash screen.

Is there something I have to do to get this to run in Vista 64-bit?
Comment
Watch Question

Commented:
The default setting for VS2008 is to use the "AnyCPU" setting which allows programs to run as 32-bit on a 32-bit PC and runs as 64-bit on a 64-bit PC.    
However, there are a few "gotcha's" to be aware of...   For example, a 64-bit application can't connect to a Microsoft Access MDB file (or an Excel XLS file).   Likewise calls to the Windows APIs need to be more precisely defined.
So, to solve the problem (either permanetly, or temporarily while hunting down coding errors), I'd suggest that you recompile the application using the "x86" flag instead of "AnyCPU".

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Commented:
oops, I had forgotten that the Express Edition doesn't have a convienent way to switch between compile "targets".
here is an article that shows how to edit the *.vbproj file by hand (via notepad) to change the target from AnyCPU to x86
http://www.onteorasoftware.com/post/Changing-the-target-cpu-in-VB-express-2008.aspx 

Author

Commented:
Thank you so much... that did the trick!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.