C#应用程序仅适用于某些计算机 [英] C# Application only working on certain computers

查看:70
本文介绍了C#应用程序仅适用于某些计算机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我做了一个申请,一切都按计划进行,除了一件我无法弄清楚的事情。该应用程序仅适用于某些计算机。我把它安装在我的Windows 8机器上,它工作正常。我把它安装在我的Windows 7机器上,没有任何反应。当您运行应用程序时,NOTHING会发生。没有错误,没有.....然后我把它安装在另一台Windows 7机器上,它就在那个上面工作了。我以为可能是我的电脑有问题,所以我尝试了另一台Windows 7机器再次无效。我在第二台Windows 8机器上安装它,它工作。所以我无法弄清楚这两台机器上缺少什么。 .Net框架都是最新的,我的程序所需的其他所有内容也都已安装。事实上,正在运行的Windows 7机器是一台机器,我安装了一个干净的Windows副本,用于测试我的应用程序。



SO ...



Windows 7中有1个有效,而Windows 8有2个有2个。有没有人经历过这个?

Hi All,

I made an application and everything is working as planned except for one thing that I cannot figure out. The application is only working on some computers. I installed it on my Windows 8 machine and it worked. I installed it on my windows 7 machine and nothing happens. When you run the application NOTHING happens. no error, nothing..... Then I installed it on another windows 7 machine and it worked on that one. I thought it might be my computer that is faulty so I tried on yet another windows 7 machine and again it did not work. I installed it on a second windows 8 machine and it worked. So I cannot figure out what is missing on these two machines. the .Net frameworks are all up to date and everything else that my program needs is installed as well. In fact the windows 7 machine that is working is a machine that I installed a clean copy of windows for the purpose of testing my application.

SO...

Windows 7 has 1 out of 3 that works and Windows 8 has 2 out of 2. Have anyone experienced this before??

推荐答案

如果您的应用程序有源代码,那么找出正在发生的事情的最有效方法是在 main()方法。

If you have the source code to your application then the most effective way to find out what is happening is to log the highest level exception to disk in the main() method.
try
{
}
catch(Exception ex)
{
   File.WriteAllText("error.txt", ex.ToString());
}


这篇关于C#应用程序仅适用于某些计算机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆