VB.NET中的System.AccessViolationException

时间:2014-11-21 09:45:28

标签: .net vb.net

我正在尝试追踪此错误,甚至陷阱以防止它崩溃应用程序。该应用程序使用.NET 4在VB.NET中编写。

Application: Satcom Discovery Socket.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Net.UnsafeNclNativeMethods+SafeNetHandles.closesocket(IntPtr)
   at System.Net.SafeCloseSocket+InnerSafeCloseSocket.ReleaseHandle()
   at System.Runtime.InteropServices.SafeHandle.DangerousRelease()
   at System.Net.SafeCloseSocket.CloseAsIs()
   at System.Net.Sockets.Socket.Dispose(Boolean)
   at System.Net.Sockets.Socket.Dispose()
   at System.Net.Sockets.Socket.Close(Int32)
   at System.Net.Sockets.NetworkStream.Dispose(Boolean)
   at System.IO.Stream.Close()
   at MySql.Data.MySqlClient.TimedStream.Close()
   at MySql.Data.MySqlClient.MySqlStream.Close()
   at MySql.Data.MySqlClient.NativeDriver.Close(Boolean)
   at MySql.Data.MySqlClient.Driver.Dispose(Boolean)
   at MySql.Data.MySqlClient.Driver.Close()
   at MySql.Data.MySqlClient.MySqlConnection.CloseFully()
   at MySql.Data.MySqlClient.MySqlConnection.Close()
   at SatcomDiscoverySocket.modDatabase.DeleteStatus(SatcomDiscoverySocket.Status ByRef, Int32)
   at SatcomDiscoverySocket.frmSocket.TimerSocketConn_Tick(System.Object, System.EventArgs)
   at System.Windows.Forms.Timer.OnTick(System.EventArgs)
   at System.Windows.Forms.Timer+TimerNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr, Int32, IntPtr, IntPtr)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG ByRef)
   at System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr, Int32, Int32)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application+ThreadContext.RunMessageLoop(Int32, System.Windows.Forms.ApplicationContext)
   at System.Windows.Forms.Application.Run(System.Windows.Forms.ApplicationContext)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(System.String[])
   at SatcomDiscoverySocket.My.MyApplication.Main(System.String[])

事件日志中的另一个错误是

  

错误应用程序名称:Satcom Discovery Socket.exe,版本:1.0.0.0,时间戳:0x5465cfdd   错误模块名称:ntdll.dll,版本:6.1.7601.18247,时间戳:0x521ea8e7   异常代码:0xc0000005   故障偏移:0x0002e3be   错误进程id:0x94c   错误应用程序启动时间:0x01d004411406ec37   错误的应用程序路径:D:\ SocketDaemon \ Satcom Discovery Socket.exe   错误模块路径:C:\ Windows \ SysWOW64 \ ntdll.dll   报告编号:2cefa3fd-70d4-11e4-8cc0-002219a5cbd1

有什么想法吗?

我以为我有未处理的异常被以下代码

所困
            'for regular unhandled stuff 
        AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf MYGeneralExceptionHandler
        'for threads behind forms 
        AddHandler Application.ThreadException, AddressOf MyThreadExceptionHandler

任何指针都会非常感激。

谢谢,

0 个答案:

没有答案