2
加載我正在處理的WinForms應用程序的mainform時,遇到了一個熟悉的異常:a「爲了防止在加載設計器之前可能發生數據丟失,必須解決以下錯誤「錯誤。堆棧跟蹤如下:查找VS2010中設計器異常的源代碼
Object reference not set to an instance of an object.
Instances of this error (4)
1. Hide Call Stack
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)
at Microsoft.VisualStudio.Shell.Design.VsTargetFrameworkPropertyDescriptor.SetValue(Object component, Object value)
at System.Windows.Forms.Design.ControlDesigner.CanResetSizePropertyDescriptor.SetValue(Object component, Object value)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)
我知道是什麼導致了這個錯誤 - 有在MainForm的地方埋四根線,引用了並不在設計時存在的Image對象。我甚至知道如何解決這個錯誤,這要歸功於this post at MSDN。麻煩的是,我找不到引發異常的行。通常我會使用Error List window導航到異常,但它表示沒有錯誤。關於如何找到違規行的任何想法?