倒Net

Net学习,自写运行库,书籍翻译,资料下载

博客园 首页 新随笔 联系 订阅 管理

在VS2008中,使用USB转串口发送字符,当拔下设备再插上,串口在使用的途中会抛出错误,用Try..Catch都无法捕获.

在 System.UnauthorizedAccessException 中第一次偶然出现的“System.dll”类型的异常
“Gosun.SMC.SMS.WindowService.exe”(托管): 已加载“C:"Windows"assembly"GAC_MSIL"System.Transactions.resources"2.0.0.0_zh-CHS_b77a5c561934e089"System.Transactions.resources.dll”
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>未处理的异常</Description><AppDomain>Gosun.smc.sms.windowservice.exe</AppDomain><Exception><ExceptionType>System.UnauthorizedAccessException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>对端口的访问被拒绝。</Message><StackTrace>   在 System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
   在 System.IO.Ports.InternalResources.WinIOError()
   在 System.IO.Ports.SerialStream.Dispose(Boolean disposing)
   在 System.IO.Ports.SerialStream.Finalize()</StackTrace><ExceptionString>System.UnauthorizedAccessException: 对端口的访问被拒绝。
   在 System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str)
   在 System.IO.Ports.InternalResources.WinIOError()
   在 System.IO.Ports.SerialStream.Dispose(Boolean disposing)

   在 System.IO.Ports.SerialStream.Finalize()</ExceptionString></Exception></TraceRecord>

这应该是serialport的一个Bug!!


posted on 2008-08-13 14:37  anqincmt  阅读(3665)  评论(12编辑  收藏  举报