私は途方に暮れています。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()