Tuesday, January 25, 2011

Silverlight error: The debugger cannot continue running the process.

Today I got this error while debugging my silverlight application and the debugger just crashed without any useful error information. I got this error when the debugger crashed:

"The debugger cannot continue running the process. Process was terminated."

After doing some debugging and research I found this thread online where in many people had the same issue because of recursive call in class property:

http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/f9b08dd4-8d20-4104-9a24-9f002caceb48/

I looked at my code and indeed I had a recursive call in one of my property by mistake.

private bool isUser;
public bool IsUser
{
get { return IsUser; }
set
{
IsUser = value;
OnPropertyChanged( "IsUser" );
}
}

As you can see in the above code my getter was recursively referring to IsUser property itself instead of the field isUser. This was just coding error but it took some time to figure out the root cause as the debugger was crashing without proper error information.