我已经黔驴技穷了。我有一个应用程序喜欢在运行时崩溃几分钟NullReferenceException
(对象引用未设置为对象的实例)。通常我可以处理得很好,但是当 Visual Studio 爆发时,它告诉我问题发生在Application.Run(new Main());
. 我不知道该怎么做才能开始解决这个问题。调用堆栈没有任何帮助,因为它只是指向那条Application.Run(new Main());
线。
我进入 Visual Studio ( CTRL + ALT + E
) 的异常窗口并告诉它向我报告所有异常。我希望它会在我得到这个之前找到问题NullReferenceException
。但没有运气。
我可以使用哪些工具来帮助查找此问题?
编辑:
这是 Visual Studio 报告的调用堆栈:
StackTrace:
at GMap.NET.WindowsForms.GMapOverlay.DrawRoutes(Graphics g)
at GMap.NET.WindowsForms.GMapOverlay.Render(Graphics g)
at GMap.NET.WindowsForms.GMapControl.OnPaintOverlays(Graphics g)
at GMap.NET.WindowsForms.GMapControl.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Foxhunt.Client.Program.Main() in C:\Users\Michael\Documents\Visual Studio 2010\Projects\Foxhunt.Client\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()