Microsoft Visual Studio已停止工作

时间:2013-01-25 20:32:32

标签: c# winforms visual-studio exception visual-studio-2012

这种情况一再发生。我只是坐在这里没有运行任何代码,它发生了。我查看了事件查看器,看起来它试图从我的一个类中运行代码。

Application: devenv.exe
Framework Version: v4.0.30319
 Description: The process was terminated due to an unhandled exception.
 Exception Info: System.ArgumentNullException
 Stack:
    at System.Data.Linq.DataContext..ctor(System.String, System.Data.Linq.Mapping.MappingSource)
    at TurnbackTools.DataClasses1DataContext..ctor(System.String)
    at TurnbackChart.TurnbackChart.ZDraw()
    at TurnbackChart.TurnbackChart.TimerTick(System.Object, System.EventArgs)
    at System.Windows.Forms.Timer.OnTick(System.EventArgs)
    at System.Windows.Forms.Timer+TimerNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
    at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

这里发生了什么?

2 个答案:

答案 0 :(得分:3)

“Microsoft Visual Studio已停止工作”不是我看到的错误。我看到的那个在不允许的时候指定了一个空参数(System.ArgumentNullException)。

你有完整的调用堆栈。并且,在调试器中,您可以单击它们以查找参数为null的行。

一旦您习惯使用调试器,这实际上是非常微不足道的。当然,解决它可能更复杂,但至少应该首先缩小导致错误的原因。

答案 1 :(得分:0)

我已经弄清楚了。我的代码创建了一个TIMER。然后,当应用程序停止时,它不会处理计时器。然后在应用程序停止后,即我回到编写代码时,计时器事件一直在触发。当应用程序未运行时,事件发生并抛出异常

相关问题