我花了两天的时间试图找出我的电脑上发生了一个奇怪的问题。
我正在调试一个用 .NET 1.1 编写的相当复杂的旧应用程序,该应用程序由一个 mdi 容器制作,该容器在运行时加载不同的程序集,这些程序集将自定义接口实现为 windows 窗体 mdi 子项。
问题是在我的 PC 上(我在其他 PC 上尝试过并且它可以工作)应用程序抛出了一个奇怪的异常。这不是由托管代码生成的,它可能是导致框架自身通过异常的罕见情况。
我试图通过逐个注释代码来隔离问题,但这是一项非常漫长的任务。
你知道我怎样才能更快地确定这个不受欢迎的异常的原因吗?
异常是NullReferenceException,这是堆栈跟踪:
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at MyAPP in xxxx.vb:line 26