Question

I've been generally very pleased with the MVVM Foundation Messenger, but I've noticed that when a messenger call causes an exception, the Visual Studio debugger doesn't ever seem to take me to the line of code that caused the exception (instead, it jumps to the method in the Messenger class that invoked the action). This forces me to do a lot of hunting around to find the offending line of code. (Note: I figure this is all a side effect of the Messenger using weak references, which is otherwise a good thing.)

Questions:

Is there anything that can be done to improve the debugging experience when using the messenger?

Is there some setting or command in Visual Studio that would let me jump directly to the line of code that caused the exception?

At the very least, can you suggest helpful strategies for quickly isolating the cause of the exception?

(Note: I'm using Visual Studio 2008)

No correct solution

OTHER TIPS

I think the best way to debug any WPF binding issues (especially regards MVVM), is to assign a Convertor to the component that is being binded. This way you know if (and possibly when) the binding takes place. Of course this method might be effective using the messenger as well.

A quick link for using the convertor: http://www.codeproject.com/KB/WPF/debugwpfdatabinding.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top