简体   繁体   中英

C# app runs in Windows 7, but not in Windows XP

I have created an application in VS C# Express 2008 using Windows 7 as my OS. It runs perfectly fine on other W7 machines, but when we try and deploy it on a machine with XP it doesn't even run. I just get the usual "Application needs to be terminated" error message. The app was built using .NET 3.5 and all the machines have at least 3.5 installed. Is there anything that I may be able to do to get the program running in previous versions? Thanks in advance for your help.

Updated Info. The machines all use x86 32-bit OS, either XP SP3 or W7, so I don't think that there is a huge need for checks for 64-bit issues. The application itself is loading images into an image list and adding in an image when it finds a break in the file names. (eg. There are 4 images in a folder, 1-3 and 5, what the application does is iterates through each image name and the minute it sees that image 4 is missing, it adds a placeholder image and labels it image 4.)

You should set up an UnhandledExceptionEventHandler so that you can log information about the current state of your application and the exception information. It isn't going to stop your application from crashing, but it will give you more information about what happened and make it easier on your end user to give you what you need to know when the application crashes.

This article give a good description of how to do that.

First you must be sure that .Net Framework 3.5 is installed on your Windows XP machine. If everything is OK, then you should check if you are using "3rd party dlls as reference" and validate their existence and correct versions on your Windows XP machine.

Probably this can help.

记录应用程序抛出的异常,以便您可以修复它。

Not a lot of info but some things to check:

Make sure you have the latest patches on XP and SP release

Maybe you need to run the program as administrator - are you logging in as admin

Have you checked the windows appliation error log to see if there is anything there that might be helpful

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM