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

Posted on 2009-02-11
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?
Question by:rmmarsh
    LVL 41

    Accepted Solution

    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".
    LVL 41

    Assisted Solution

    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

    Author Closing Comment

    Thank you so much... that did the trick!

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Start up error 3 650
    MS Vista OS 12 253
    Right-Clicking In Windows Vista 4 270
    Forgotten Admin Password Windows Vista 7 42
    So who is this article for? If you are like most of the computer users out there, you probably only realize the meaning of 'System maintenance' after something goes wrong. This article is for you if you care about keeping your system working opti…
    I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
    The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
    This video discusses moving either the default database or any database to a new volume.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now