“The debugger cannot continue running the process.

2019-06-15 05:03发布

I've been messing with VS 2010 debugging settings, trying to get stepping into the .NET Framework working. Well, I can't get it to work. I've also tried the Reflector VS plugin and that was working at one point.

Then I randomly started getting this error:

enter image description here

This only happens when I have a breakpoint on a line that calls IEnumerable<T>.ToList(). If I try to step-over or step-into on that line where my breakpoint is set, I get this error dialog and my debugging session ends.

If I move the breakpoint to the line below, the debugger makes it past the ToList() call!

I've tried the following to no avail:

  • Removing the Reflector plugin.
  • Undoing my changes in the Tools > Options > Debugging window (unchecked the option to step into the .NET Framework; unchecked the source server option; checked the just my code option).
  • Unchecked Microsoft Source Server in the Tools > Options > Debugging > Symbols window.
  • Cleared the symbol cache.

What is going on?

9条回答
别忘想泡老子
2楼-- · 2019-06-15 05:17

I suffered from same problem....

I found one solution which heard uncommon....

The debugger cannot continue running the process.Process was terminated While debugging your code step by step , you will find the line , from where error redirecting. If you are using " ToString() " anywhere in that file ,please remove that . Instead of the ,you can use Value / Text . It works fine. ............

If you were not used ToString() any where in program , then reload project copy by removing completely.

查看更多
别忘想泡老子
3楼-- · 2019-06-15 05:17

I ran into this issue with a code bug from copy/paste. Instead of get/setting the private member variable, I did a get/set on itself. When I referenced the property in other code the debugger terminated (2010):

public bool ProdToDeve
{
   get { return ProdToDeve; } // <= missing underbar
   set { ProdToDeve = value; }
}
private bool _ProdToDeve = false;
查看更多
仙女界的扛把子
4楼-- · 2019-06-15 05:21

I had the same problem. I traced it down to a class(step-by-step debugging) and finally to a property(commenting all the code, then step-by-step uncommenting).

this property returned a typed dataSet from a table.Dataset

private typedDataSet myDataSet
{
   return this.DataSet as typedDataSet;
}

this was in a DataTable partial class. After I removed this property everything went OK.

查看更多
男人必须洒脱
5楼-- · 2019-06-15 05:23

It was a ToString() override that make the debugger crash ! (After the evaluation the debugger will show you the result with the ToString() method). And if you get an exception in the ToString(), you will never catch an exception because you cannot code them on the debugger behaviour.

I've got this answer from msdn

查看更多
Viruses.
6楼-- · 2019-06-15 05:27

It occurred to me when I was doing the following:

throw new Exception(timeout.TotalSeconds + " second(s)");

That's because timeout.TotalSeconds.ToString() which indeed is an override method for an object of type double, was throwing a Parameter not valid exception.

Finally, for safety I ended up doing the following:

throw new Exception(System.Convert.ToString(timeout.TotalSeconds));

查看更多
干净又极端
7楼-- · 2019-06-15 05:31

I've just found this answer useful. All I did was change my start-up project to another, and back to normal.

My project probably lost this setting somewhere, and resetting it made it available again.

查看更多
登录 后发表回答