我们遇到了一个问题,即尝试在 Visual Studio(2010 或 2012)中打开特定的设计器文件会导致它无法恢复地崩溃(“Visual Studio 已停止工作”)。
尝试执行此操作时将调试器附加到进程会引发System.NullReferenceException
, 带有堆栈跟踪:
at System.Windows.Forms.NativeWindow.AddWindowToTable(IntPtr handle, NativeWindow window)
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean assignUniqueID)
at System.Windows.Forms.Design.ControlDesigner.ChildSubClass..ctor(ControlDesigner designer, IntPtr hwnd)
at System.Windows.Forms.Design.ControlDesigner.HookChildHandles(IntPtr firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.HookChildControls(Control firstChild)
at System.Windows.Forms.Design.ControlDesigner.OnHandleChange()
at System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.OnHandleChange(IntPtr newHandle)
at System.Windows.Forms.Control.ControlNativeWindow.OnHandleChange()
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean assignUniqueID)
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle)
at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
此问题始终出现在我们已更新到 Windows 8 企业版(现在使用 SSD)的开发盒上。Windows 7 Professional 上的旧盒子始终不会出现这种行为。该问题似乎也只发生在特定的设计器文件上,但目前尚不清楚原因。
有没有人有任何解决这个问题或进一步调查的建议?