OK, vì vậy tôi đã tạo một ứng dụng C# và cài đặt nó trên hộp kiểm tra của tôi. Ứng dụng của tôi hoạt động hoàn hảo trên hộp dev của tôi, nhưng khi tôi cài đặt trên một máy khác, nó gặp sự cố trong Main(). Tôi nhận được eventType: CLR20r3C# windows appication Sự kiện: CLR20r3 trên ứng dụng bắt đầu
đây là sự kiện Tin
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
tôi đã sử dụng các chi tiết và nhìn lên các mã lỗi trong IL disassembler và cam trở lại với những điều sau đây ...
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 đã được gỡ cài đặt và cài đặt lại trên hệ thống và không thay đổi bất cứ điều gì. Tôi đã tìm kiếm trên tất cả các mạng và tất cả mọi người với cùng một vấn đề dường như không có một giải pháp. Bây giờ tôi đã dành một ngày rưỡi cho vấn đề này. Tôi sẽ ghét bỏ lỡ thời hạn của tôi để không thể khởi chạy ứng dụng.
Đây là mã duy nhất trong chính tôi()
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new frmMain());
}
Sau đây là các chi tiết từ Event Viewer
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()
EventData
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()
Không chắc cách nhà thiết kế có thể có một ngoại lệ FileNotFound. Tôi đang sử dụng DotNetBar.dll và tôi tham khảo nó ra khỏi thư mục cài đặt, vì vậy mà nên được tốt. Tôi có thể đăng thiết kế của tôi nếu bạn muốn, nhưng có khá nhiều ở đó. có ai có ý tưởng gì không?
Nắm bắt ngoại lệ FileNotFoundException và xem chi tiết của nó để hiểu tệp nào bị thiếu. Tôi cá là DotNetBar.dll – tenorsax
Vâng, đó là DotNetBar. Tôi đã phải di chuyển nó đến gốc ứng dụng mặc dù tôi đã tham chiếu nó từ một thư mục có tên là "tài nguyên". – Tyler