简体   繁体   English

C#app在Windows 7中运行,但在Windows XP中不运行

[英]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. 我使用Windows 7作为我的操作系统在VS C#Express 2008中创建了一个应用程序。 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. 它在其他W7机器上运行得非常好,但是当我们尝试将它部署在装有XP的机器上时,它甚至都没有运行。 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. 该应用程序是使用.NET 3.5构建的,所有机器至少安装了3.5。 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. 这些机器都使用x86 32位操作系统,XP SP3或W7,所以我认为不需要检查64位问题。 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.) (例如,文件夹中有4个图像,1-3和5,应用程序所做的是遍历每个图像名称,并且它看到图像4缺失的分钟,它添加占位符图像并将其标记为图像4.)

You should set up an UnhandledExceptionEventHandler so that you can log information about the current state of your application and the exception information. 您应该设置UnhandledExceptionEventHandler以便您可以记录有关应用程序当前状态和异常信息的信息。 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. 首先,您必须确保Windows XP计算机上安装了.Net Framework 3.5。 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. 如果一切正常,那么您应该检查您是否使用“第三方dll作为参考”并在Windows XP计算机上验证它们的存在和正确版本。

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 确保您拥有XP和SP版本的最新补丁

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 您是否检查过Windows应用程序错误日志,看看是否有任何可能有用的内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows XP上如何在C#中使用语音识别? +我需要训练每台运行该应用程序的PC吗? - How can I use speech recognition with C# on Windows XP? + do I need to train every pc that runs the app? 我的 C# windows 应用程序在系统启动时运行。 但适用于 windows xp 而不适用于 windows 7。我已经编写了这些代码 - my C# windows application runs on system startup. but works in windows xp and not in windows 7. I have written these codes C#-Windows XP Professional上的布局问题 - C# - Layout problem on Windows XP professional 套接字keepalive与XP一起使用,但不适用于Windows 7 C# - socket keepalive works with xp but not with windows 7 c# 使用C#在Windows XP上发送奇怪的行为 - SendKeys strange behaviour on Windows XP in C# Windows XP上的C#XmlSerialization失败 - C# XmlSerialization failing on Windows XP Windows XP中的C#USB移除事件 - C# USB removal event in Windows XP XP和Windows 7之间的C#区别 - C# difference between XP and Windows 7 DateTimePicker C#在Windows XP上无法正常工作 - DateTimePicker C# not working correctly on Windows XP 使用Visual Studio 2012创建的C#Windows窗体应用程序无法在Windows XP上运行 - C# Windows forms app created using Visual Studio 2012 not working on windows xp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM