我已經編寫並測試了一個WinForms應用程序,並且在我的機器上一切都正常工作(我知道這是陳詞濫調)。當我創建了一個安裝項目和安裝了一個同事的機器上,他收到以下消息:異常處理幫助
************** Exception Text **************
System.IndexOutOfRangeException: There is no row at position 0.
at System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex)
at System.Data.RBTree`1.get_Item(Int32 index)
at System.Data.DataRowCollection.get_Item(Int32 index)
at MyApp.MainForm.MainForm_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.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.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
我承認我是一個新手,當涉及到處理這樣的一個例外。這段文字對我來說並沒有什麼意義,我不確定調試這種方法的最佳方式,因爲我無法在我的機器上發生錯誤。
任何人都可以告訴問題是什麼,或者建議我調試這個最好的方法嗎?任何幫助是極大的讚賞!
你可以發佈'MyApp.MainForm.MainForm_Load'的代碼嗎? – 2009-12-01 21:51:10