I've successfully made several Visual Studio debugger visualizers, and they're working very well, except that on some objects I get a time out error when I try to deserialize the object with objectProvider.GetObject()
System.Exception: Function evaluation timed out.
at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.PrivateCallback.MaybeDeserializeAndThrowException(Byte[] data)
The time out happens rather quickly (maybe about a second after I click on the visualizer icon), even though some of my other visualizers work fine even with large data objects that much longer to display (5-10 seconds) and still don't timeout.
I've already made a custom object source to limit the serialization to the fields I need to display. What else can I do to get the data to deserialize without timing out?
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Debugger
I think this is not documented, but you can try changing some of the Timeouts in the above registry key, and restart Visual Studio.
I was recently hit by this in VS2012 and after googling I found this:
As the exception message says, this exception means the debugger visualizer for the datatable is timed out. In VS debugger, each expression evaluation windows(such as watch window, locals window, datatips, autos window etc..) has different default max expression evaluation timed out value. For datatip, we prefer to give a short time out value because otherwise it will provide a poor user expression. If you do want to use the visualizer functionality for that datatable, you may add the expression to a watch and try to visualize it.(Because watch window has a longer timeout value). If you do want to get rid of this timeout in datatip, you may try to increase the timeout value for datatip. The timeout value is a setting in "DataTipTimeout" registry key under: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Debugger Note: you should probe WOW64Node for 64bit OS. You can also see other windows' default timeout value under this key.
To Visual Studio debugger work well - "Locals" window in "WPF visualizer" (tested in WPF application), you need to find in registry: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\Debugger\ DWORD parameter "LocalsTimeout" and default value (1000) set to big enough value, 5000, for example.
来源:https://stackoverflow.com/questions/787334/how-to-keep-visual-studio-debugger-visualizers-from-timing-out