简体   繁体   English

.NET Winforms应用程序在启动时死机

[英].NET Winforms app dies on startup

I have a .NET Winforms app written in C# which works everywhere but on one particular machine. 我有一个用C#编写的.NET Winforms应用程序,它可以在一台特定的机器上运行。 On that machine it dies without ever starting. 在那台机器上它没有启动就死了。 There is no error message, but the following is written to the event log: 没有错误消息,但以下内容写入事件日志:

Type: Error 类型:错误

Source: .NET Runtime 2.0 Error Reporting 来源:.NET Runtime 2.0错误报告

Description: Faulting application myapp.exe, version 4.2.0.0, stamp 4bcf05d0, faulting module kernel32.dll, version 5.2.3790.4480, stamp 49c51f0a, debug? 描述:错误应用程序myapp.exe,版本4.2.0.0,邮票4bcf05d0,错误模块kernel32.dll,版本5.2.3790.4480,邮票49c51f0a,调试? 0, fault address 0x0000bef7. 0,故障地址0x0000bef7。

There doesn't seem to be anything odd about that machine - it is one of a number of clones created with VSphere, and doesn't exhibit any other issues. 这台机器似乎没什么奇怪的 - 它是用VSphere创建的许多克隆之一,并没有出现任何其他问题。 The other clones run my app without any problem. 其他克隆运行我的应用程序没有任何问题。 It is Windows Server 2003 SP2 with .NET Framework 3.5 SP1, running Citrix, which was reinstalled after the clone to take the new name (as were the other clones). 它是带有.NET Framework 3.5 SP1的Windows Server 2003 SP2,运行Citrix,在克隆之后重新安装以获取新名称(与其他克隆一样)。

Any advice on how to diagnose or trap the issue? 有关如何诊断或捕获问题的任何建议?

Also, I am soon going to release a new version of my app, is there anything I can do to the new version to give more information on this kind of problem? 另外,我很快就会发布我的应用程序的新版本,我可以对新版本做些什么来提供有关此类问题的更多信息吗?


EDIT: Thank you all for your answers, unfortunately the sysadmins for the machine decided to just rebuild it from scratch, and the problem went away. 编辑:谢谢大家的答案,不幸的是机器的系统管理员决定从头开始重建它,问题就消失了。 So I'll probably never know what the problem was. 所以我可能永远不会知道问题是什么。

Install Debugging tools for Windows on that machine, and use WinDbg to launch your application. 在该计算机上安装Windows的调试工具,并使用WinDbg启动您的应用程序。 Then it should tell what exceptions happen. 然后它应该告诉发生什么异常。

If the error is related to environment (such as missing assembly) then the app will not reach a point where you can trap & log it. 如果错误与环境有关(例如缺少程序集),那么应用程序将无法到达您可以捕获并记录它的位置。

I would create a new console application and then load such app into new AppDomain and run it with ExecuteAssembly. 我将创建一个新的控制台应用程序,然后将此类应用程序加载到新的AppDomain中并使用ExecuteAssembly运行它。 If the errors are .NET exceptions you will be able to catch them and write to a console window. 如果错误是.NET异常,您将能够捕获它们并写入控制台窗口。

Is your MyApp.Exe.Config a correct XML file? 您的MyApp.Exe.Config是否是正确的XML文件? Open it in Visual Studio, and see if there are any errors against the XML format. 在Visual Studio中打开它,看看是否有任何针对XML格式的错误。

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

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