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:
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?
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.
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):
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
this was in a DataTable partial class. After I removed this property everything went OK.
It was a
ToString()
override that make the debugger crash ! (After the evaluation the debugger will show you the result with theToString()
method). And if you get an exception in theToString()
, you will never catch an exception because you cannot code them on the debugger behaviour.I've got this answer from msdn
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 typedouble
, was throwing aParameter not valid
exception.Finally, for safety I ended up doing the following:
throw new Exception(System.Convert.ToString(timeout.TotalSeconds));
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.