简体   繁体   English

Visual C#-程序将无法运行

[英]Visual C# - Program Will Not Run

I made a program with Visual Studio 2010. It required .NET Framework 4.0 to run, and the machine it needs to run on is not connected to the internet, so I found the redistributable online on my own machine and copied it over. 我使用Visual Studio 2010创建了一个程序。它需要运行.NET Framework 4.0,并且它需要在其上运行的计算机未连接到Internet,因此我在自己的计算机上找到了可重新分发的联机文件,并将其复制了过来。

I installed the software on the machine (it's a very simple program, I just made up an installer to do the .NET installation as well as putting the .exe file of my program into Program Files) but any time I try to run it, I get a Windows Error Report message saying the program failed to run. 我在计算机上安装了该软件(这是一个非常简单的程序,我只是组成了一个安装程序以进行.NET安装,并将程序的.exe文件放入“程序文件”中),但是任何时候我尝试运行它时,我收到Windows错误报告消息,提示程序无法运行。

Are there any suggestions as to where I could look for the cause of this issue? 关于在哪里可以找到此问题的原因有什么建议吗?

(If it matters, the machine I'm trying to run it on is running Windows XP while I am running Windows 7. I don't think this is a compatibility issue though...) (如果很重要,我尝试在其上运行的计算机在运行Windows 7的同时正在运行Windows XP。尽管如此,我认为这不是兼容性问题...)

The problem you're having is with error handling. 您遇到的问题是错误处理。 There is probably an environmental issue such as a missing folder, registry setting, or some other configuration. 可能存在环境问题,例如缺少文件夹,注册表设置或某些其他配置。 That would explain why it works on your dev machine and not the other (a common occurrence.) Your app is throwing an unhandled exception and crashing. 那可以解释为什么它可以在您的开发机器上而不是其他机器上正常工作(常见情况)。您的应用程序抛出未处理的异常并崩溃。

There may be information on the error in the Application log, including a stacktrace you can use to diagnose the issue. 应用程序日志中可能包含有关错误的信息,包括可用于诊断问题的堆栈跟踪。 Once you have determined the problem, you will also want to ensure that you have sufficient exception handling so you can raise friendly error messages and prevent your app from crashing. 确定问题后,您还需要确保具有足够的异常处理能力,以便引发友好的错误消息并防止应用程序崩溃。

可能是因为您构建了一个64位应用程序,并试图在32位计算机上运行它。

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

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