English 中文(简体)
排在C#
原标题:Exception is not caught in C#
  • 时间:2012-04-26 16:07:21
  •  标签:
  • c#
  • .net

我有一个窗口服务应用程序。 我把我的所有守则放在一个试办栏内,但应用却几次坠毁。 下面是一些错误的信息,即来自无法从该守则中删除任何内容的视器。 请允许我就此向我提供协助。

Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: bgfcimportjobs.exe
P2: 1.0.0.12
P3: 4f8ee332
P4: mscorlib
P5: 2.0.0.0
P6: 4e1539fa
P7: 349e
P8: 1c5
P9: System.IO.IOException
P10: 

Attached files:

These files may be available here:
C:ProgramDataMicrosoftWindowsWERReportQueueAppCrash_bgfcimportjobs.e_70609b5d8d50b31a8e1a14872a72bb7a82791b3a_2d2ac10e

Analysis symbol: 
Rechecking for solution: 0
Report Id: 1f7048c8-8f63-11e1-8875-b499ba03bf80
Report Status: 4

Thanks in advance!!!

问题回答

你们是否真的相信,这完全在审判中? 你们需要围绕所有事件处理者以及任何类似情况补充。

由于这是国际奥委会的一个例外,你是否有任何读/书写档案的法典?

你的法典属于Try区,但在你尝试之后,你是否拥有一个Catch区?

try
{
   some code...
}
catch(Exception e) 
{
    string message = e.Message;
}

你们是否把被俘者排除在外,以便你能够实际看到什么?

另外,你也可以开脱。 发射(,并通过它来了解正在发生的情况

可以是,你不要把你试图 block倒的例外情况 catch倒。

Do you catch the right exceptions?
You should at least catch System.IO.IOException or a base class of it.
In catch block you should log the whole exception, i.e.:

try
{
  your code...
}
catch(IOException e) 
{
  YourLogger.WriteMessage(e);
}

因此,你也发现了例外的痕迹。

开放式VS 2010。 Go to Debug > Statelessnessions menu. 现在,在Thrown类别下选择所有检查箱。

提供这些服务,并随附使用Debug >的进程; Attach to Process。

现在,如果出现任何错误,执行将说明提出问题的守则。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签