我创建了一个 C# 应用程序并将其安装在我的测试盒上。我的应用程序在我的开发盒上运行完美,但是当我安装在另一台机器上时,它在 Main() 中崩溃。我得到事件类型:CLR20r3
这是事件消息
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: logfileviewer.exe
Problem Signature 02: 1.0.0.0
Problem Signature 03: 4f356c9c
Problem Signature 04: LogFileViewer
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4f356c9c
Problem Signature 07: 94
Problem Signature 08: 44
Problem Signature 09: System.IO.FileNotFoundException
OS Version: 6.1.7601.2.1.0.256.1
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
我使用了详细信息并在 IL Disassembler 中查找错误代码并返回以下内容...
Method #5 (06000094)
-------------------------------------------------------
MethodName: .ctor (06000094)
Flags : [Public] [HideBySig] [ReuseSlot] [SpecialName] [RTSpecialName] [.ctor] (00001886)
RVA : 0x000081d0
ImplFlags : [IL] [Managed] (00000000)
CallCnvntn: [DEFAULT]
hasThis
ReturnType: Void
No arguments.
.NET 4.0 已被卸载并重新安装在系统上,并没有改变任何东西。我在网上搜索了所有有同样问题的人似乎都没有解决方案。我现在已经花了一天半的时间来解决这个问题。我不想错过我无法启动应用程序的最后期限。
这是我的 Main() 中唯一的代码
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
以下是事件查看器的详细信息
Application: LogFileViewer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at LogFileViewer.frmMain.InitializeComponent()
at LogFileViewer.frmMain..ctor()
at LogFileViewer.Program.Main()
事件数据
Application: LogFileViewer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack: at LogFileViewer.frmMain.InitializeComponent() at LogFileViewer.frmMain..ctor() at LogFileViewer.Program.Main()
不确定设计器如何拥有 FileNotFound 异常。我正在使用 DotNetBar.dll 并且我从安装目录中引用它,所以这应该很好。如果你愿意,我可以发布我的设计师,但那里有很多。