I'm debugging an application in Visual Studio 2010 going step by step and, astonishingly, it jumps back to a part of code that doesn't suppose to, in a non linear manner. I run the code in a unit test, with debug (using resharper) and Visual Studio just stops, it doesn't say stackoverflow or anything after waiting for a while.
I think it is a bug. I happened at another time as well. Why would it jump code in such an arbitrary manner?
Do you know how to prevent this? Is some particular way of coding that makes this bug prone to happen?
Edit: Part of the code where it jumps to:
foreach (var elemento in expresion.ElementosUsados)
{
valoresElementos.Add(new ValorYNombre(elemento.Nombre, elemento.GetValor(valoresBase)));
}
at that time the value of "elemento" would be equal to "this" (a reference to the same object)
Are you compiling with Optimization enabled? This can lead to code which will not perfectly mimic the flow of your written code but will mimic its functionality. This results in the debugger seemingly jumping from operation to operation.
EDIT by Olivier Jacot-Descombes:
I added the image here, since I cannot add it to a comment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With