XNA: el proceso finaliza inesperadamente durante la depuración

I have a curious problem with debugging my XNA project. Whenever I hit a certain breakpoint and start browsing the "Locals" window, the whole process and the debugger terminate without giving any notice as to why. The trigger might be reaching a field with a red exclamation mark that says "Function evaluation was aborted."

I am using no explicit multithreading in my code, therefore I am befuddled how the process can terminate (seemingly as though it correctly reached the end) when it actually doesn't run.

Gracias por cualquier ayuda.

preguntado el 02 de febrero de 12 a las 10:02

It sounds as though the attached debugger may be crashing. Is it always on the same breakpoint / method evaluation; or is it seemingly random? Also, what version of Visual Studio are you using (i.e Express, Professional, Ultimate)? -

I'm using VS2010 Ultimate, it is not entirely random, however I think the crash occured on multiple breakpoints. Interesting is, that when I don't browse the Locals and just let the debugger be after hitting the breakpoint, nothing happens. -

It does sound like the debugger itself is crashing when trying to evaluate the locals. I have had a similar issue before and it's not particularly easy to isolate. -

Any chance to at least get some error message from the debugger? -

If the solution you have found works, post it as an answer and accept it so others can identify the solution easily. -

2 Respuestas

This is occurring because your accessor is infinitely recursive, causing a stack overflow.

Cambia esto:

get { return Level; }

A esto:

get { return level; }

This is actually a fairly common thing in Visual Studio C#, it's very annoying, the auto-complete feature will always prefer the accessor name over the member name, even when you're within the accessor itself. I figured after 5 years of this Microsoft would've fixed it by now.

EDIT: n/m I see you already came to this conclusion in your own question. I guess I should read the entire thing first, I jumped the gun.

Respondido 04 Feb 12, 08:02

Ok, I have found the solution, so, for anyone who might happen upon this question with a similar problem: The debugger hangs when trying to evaluate a property that causes a stack overflow, i.e

protected int level;
    public int Level
        get { return Level; }

as is further explained here http://netpl.blogspot.com/2009_05_01_archive.html

Respondido 10 Feb 12, 13:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.