C# windows 应用程序事件 : CLR20r3 on application start

标签 c# .net file-not-found

我创建了一个 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 并且我从安装目录中引用它,所以这应该很好。如果你愿意,我可以发布我的设计师,但那里有很多。

最佳答案

当我的应用程序依赖于部署计算机上不存在的引用程序集时,我也遇到过同样的问题。我不确定“从安装目录中引用 DotNetBar”是什么意思 - 确保将其设置为 CopyLocal=true在您的项目中,或者存在于您的开发和生产机器上的相同完整路径中。

关于C# windows 应用程序事件 : CLR20r3 on application start,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9244694/

相关文章:

c# - 从不同的非结构化文本文件中检索信息 - 文本挖掘?

c# - Monotouch 和异步 CTP

c# - WPF 控件初始化的顺序 - IsEnabled

objective-c - import "cocos2d.h"在一些文件中有效,但不是全部

Python 为 os.listdir 返回的文件名引发 FileNotFoundError

c# - 类型直接或间接取决于自身 Simple Injector

c# - 为什么 ICommand 对象必须公开才能在 WPF 中正常工作?

c# - 在 C# 中将两种方法组合在一起

C#属性继承问题

java - 资源文件由 Gradle 找到,但不由 Eclipse 找到