C# 应用程序在 Windows 7 中运行,但不能在 Windows XP 中运行
我使用 Windows 7 作为操作系统在 VS C# Express 2008 中创建了一个应用程序。它在其他 W7 机器上运行得很好,但是当我们尝试将它部署在 XP 机器上时,它甚至无法运行。我只是收到常见的“应用程序需要终止”错误消息。该应用程序是使用 .NET 3.5 构建的,所有计算机都至少安装了 3.5。我可以做些什么来让程序在以前的版本中运行吗?预先感谢您的帮助。
更新信息。这些机器都使用 x86 32 位操作系统,XP SP3 或 W7,因此我认为不需要检查 64 位问题。应用程序本身会将图像加载到图像列表中,并在发现文件名中断时添加图像。 (例如,文件夹中有 4 个图像,1-3 和 5,应用程序所做的就是迭代每个图像名称,当它发现图像 4 丢失时,它会添加一个占位符图像并将其标记为图像 4。)
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.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(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.This article give a good description of how to do that.
首先,您必须确保 Windows XP 计算机上安装了 .Net Framework 3.5。如果一切正常,那么您应该检查您是否使用“第 3 方 dll 作为参考”并验证它们在 Windows XP 计算机上的存在和版本是否正确。
也许这会有所帮助。
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.
记录应用程序引发的异常,以便您可以修复它。
Log the exception which is thrown by the application so that you can fix it.
信息不多,但有一些需要检查的事项:
确保您有 XP 和 SP 版本的最新补丁
也许您需要以管理员身份运行该程序 - 您是否以管理员身份登录
您是否检查过 Windows 应用程序错误日志以查看是否那里有什么可能有帮助的
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