我创建了一个C#应用程序并将其安装在测试机上。我的应用程序在开发机上运行得很完美,但是当我在另一台机器上安装它时,在Main()函数中会崩溃,并收到EventType: 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,它是从安装目录引用的,所以应该没问题。如果您愿意,我可以发布我的设计器,但那里有相当多的内容。