【问题标题】:How to debug a low level system exception in Visual Studio 2003?如何在 Visual Studio 2003 中调试低级系统异常?
【发布时间】:2010-11-08 17:55:53
【问题描述】:

我花了两天的时间试图找出我的电脑上发生了一个奇怪的问题。

我正在调试一个用 .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

【问题讨论】:

    标签: .net debugging visual-studio-2003 nullreferenceexception


    【解决方案1】:

    您可以Enable .NET framework source stepping 并调试到框架代码中。也许这有助于确定原因。

    【讨论】:

    • 嗨 Daniel,很遗憾,我认为建议的页面适用于 Visual Studio 2008 或更高版本
    • @marco,Visual Studio 2008 Express 可以解决这个问题。 ;)
    • 我忽略了 VS2003 标签……但正如西蒙建议的那样,快递版应该可以。
    • @simon 我无法将项目转换为 VS2008/Framework 2.0 或更高版本。也因为我尝试过,问题不再发生。它与 Framework 1.1 相关
    • VS2008 也不能针对 .NET 1.1 吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-04
    • 2011-09-20
    • 2010-10-11
    • 1970-01-01
    • 2015-07-02
    • 1970-01-01
    相关资源
    最近更新 更多