关于.net抛出异常原因的分析

zhlicen 2013-05-06 02:25:14
经常使用.net API都会抛出异常,如果不进行处理程序就会直接退出
查看崩溃记录可以找到调用堆栈信息,不过不太会分析原因,比如:
我做的一个outlook插件需要创建邮件,然后抛出异常,异常信息如下,请帮忙分析一下

应用程序: OUTLOOK.EXE
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: System.Runtime.InteropServices.COMException
堆栈:
在 Microsoft.Office.Interop.Outlook.ApplicationClass.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType)
在 OutlookAddin.CMailManager.SendConfMail(TSdkConfInfo, EmMailType, System.String)
在 OutlookAddin.ThreadSendMail.ThreadSend()
在 System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
在 System.Threading.ThreadHelper.ThreadStart()



- System

- Provider

[ Name] .NET Runtime

- EventID 1026

[ Qualifiers] 0

Level 2

Task 0

Keywords 0x80000000000000

- TimeCreated

[ SystemTime] 2013-04-26T02:56:26.000000000Z

EventRecordID 3694

Channel Application

Computer K-1000

Security


- EventData

应用程序: OUTLOOK.EXE Framework 版本: v4.0.30319 说明: 由于未经处理的异常,进程终止。异常信息: System.Runtime.InteropServices.COMException 堆栈: 在 Microsoft.Office.Interop.Outlook.ApplicationClass.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType) 在 OutlookAddin.CMailManager.SendConfMail(TSdkConfInfo, EmMailType, System.String) 在 OutlookAddin.ThreadSendMail.ThreadSend() 在 System.Threading.ThreadHelper.ThreadStart_Context(System.Object) 在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 在 System.Threading.ThreadHelper.ThreadStart()





...全文
788 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
雯儿 2014-07-04
  • 打赏
  • 举报
回复
我也遇见了呀 怎么办呀
zhlicen 2013-05-20
  • 打赏
  • 举报
回复
zhlicen 2013-05-08
  • 打赏
  • 举报
回复
zhlicen 2013-05-07
  • 打赏
  • 举报
回复
引用 2 楼 pele7 的回复:
检查一下是不是权限的问题
非必现,出现概率极低,我现在就想知道能通过这些信息分析到具体原因么....
pele7 2013-05-06
  • 打赏
  • 举报
回复
检查一下是不是权限的问题
zhlicen 2013-05-06
  • 打赏
  • 举报
回复
异常2 写XML文件错误
错误应用程序名称: OUTLOOK.EXE,版本: 12.0.6316.5000,时间戳: 0x4833a470
错误模块名称: KERNELBASE.dll,版本: 6.2.9200.16384,时间戳: 0x5010ac2f
异常代码: 0xe0434352
错误偏移量: 0x00014b32
错误进程 ID: 0xba8
错误应用程序启动时间: 0x01ce47beacc58692
错误应用程序路径: E:\Program Files (x86)\Microsoft Office\Office12\OUTLOOK.EXE
错误模块路径: E:\Windows\SYSTEM32\KERNELBASE.dll
报告 ID: 522ba605-b3b2-11e2-be81-7071bc0a63dd
错误程序包全名: 
错误程序包相对应用程序 ID: 
- System 

  - Provider 

   [ Name]  Application Error 
 
  - EventID 1000 

   [ Qualifiers]  0 
 
   Level 2 
 
   Task 100 
 
   Keywords 0x80000000000000 
 
  - TimeCreated 

   [ SystemTime]  2013-05-03T05:28:44.000000000Z 
 
   EventRecordID 4299 
 
   Channel Application 
 
   Computer KDV-1000 
 
   Security 
 

- EventData 

   OUTLOOK.EXE 
   12.0.6316.5000 
   4833a470 
   KERNELBASE.dll 
   6.2.9200.16384 
   5010ac2f 
   e0434352 
   00014b32 
   ba8 
   01ce47beacc58692 
   E:\Program Files (x86)\Microsoft Office\Office12\OUTLOOK.EXE 
   E:\Windows\SYSTEM32\KERNELBASE.dll 
   522ba605-b3b2-11e2-be81-7071bc0a63dd 

=============================================================================================
=============================================================================================

应用程序: OUTLOOK.EXE
Framework 版本: v4.0.30319
说明: 由于未经处理的异常,进程终止。
异常信息: System.IO.IOException
堆栈:
   在 System.IO.__Error.WinIOError(Int32, System.String)
   在 System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
   在 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare)
   在 System.Xml.XmlDocument.Save(System.String)
   在 OutlookAddin.CConfigManager.RemoveConfInfo(System.String, System.String)
   在 OutlookAddin.ConfLogCleaner.ThreadCleaner()
   在 System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   在 System.Threading.ThreadHelper.ThreadStart()

- System 

  - Provider 

   [ Name]  .NET Runtime 
 
  - EventID 1026 

   [ Qualifiers]  0 
 
   Level 2 
 
   Task 0 
 
   Keywords 0x80000000000000 
 
  - TimeCreated 

   [ SystemTime]  2013-05-03T05:28:44.000000000Z 
 
   EventRecordID 4298 
 
   Channel Application 
 
   Computer KDV-1000 
 
   Security 
 

- EventData 

   应用程序: OUTLOOK.EXE Framework 版本: v4.0.30319 说明: 由于未经处理的异常,进程终止。异常信息: System.IO.IOException 堆栈: 在 System.IO.__Error.WinIOError(Int32, System.String) 在 System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean) 在 System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare) 在 System.Xml.XmlDocument.Save(System.String) 在 McsOutlookAddin.CConfigManager.RemoveConfInfo(System.String, System.String) 在 McsOutlookAddin.ConfLogCleaner.ThreadCleaner() 在 System.Threading.ThreadHelper.ThreadStart_Context(System.Object) 在 System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) 在 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) 在 System.Threading.ThreadHelper.ThreadStart()  

    

111,111

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧