本文介绍了C#应用程序运行在Windows 7中,但不是在Windows XP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了使用Windows 7作为我的操作系统在VS C#防爆preSS 2008的应用程序。它运行完美的罚款对其他W7的机器,但是当我们试图和部署的机器上使用XP它甚至不运行。我只是得到了一贯的应用程序需要被终止错误消息。该应用程序内置使用了.NET 3.5和至少3.5安装了所有机器都有。有什么,我也许能够做的就是在previous版本上运行的程序?在此先感谢您的帮助。

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.

更新信息。的机器都使用x86 32位的操作系统,无论是XP SP3或W7,所以我不认为有一个巨大的需要检查64位的问题。应用程序本身将图像加载到一个图像列表中的图像添加,当它发现在文件名中休息。 (例如,有4个图像文件夹中,1-3和5,应用程序做什么是通过每幅图像的名称和它看到的图像4缺少分钟的迭代,它增加了一个占位符图像,并对其进行标注图像4.)

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.)

推荐答案

您应该建立一个 UnhandledExceptionEventHandler ,以便您可以登录有关应用程序的当前状态信息和异常信息。它是不会阻止你的应用程序崩溃,但它会给你更多的信息,发生了什么事,并使其更容易对你的最终用户给你什么,你需要的时候知道应用程序崩溃。

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.

<一个href="http://www.switchonthe$c$c.com/tutorials/csharp-tutorial-dealing-with-unhandled-exceptions">This文章给出了如何做一个很好的说明。

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

这篇关于C#应用程序运行在Windows 7中,但不是在Windows XP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 14:43