36

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?

yoyoyoyosef
  • 7,000
  • 8
  • 40
  • 39
  • Note: I would post this as a comment but don't have enough reputation. The accepted answer is great for older versions of Visual Studio. For my version (2017), I also needed a separate stack overflow post combined with the answer here to get this working. 2017 stores its reg keys privately in AppData, and you need to load it into Registry Editor to be able to follow the advice in this post's accepted answer. Here's a link to the other post: https://stackoverflow.com/questions/41119996/where-does-visual-studio-2017-store-its-config – cfalck Aug 19 '19 at 21:37

3 Answers3

44
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.

Ying
  • 1,142
  • 2
  • 15
  • 19
  • 26
    Looks like `NormalEvalTimeout` is the value to change (value is specified in milliseconds). `QuickwatchTimeout` is also worth updating if you use this feature (hovering over a variable in the debugger to view it's current value). The defaults for these values are are 5000 and 15000 respectively if you need to restore them. – alastairs Oct 20 '10 at 14:42
  • 3
    As with other registry keys, make sure Visual Studio is closed (no `devenv` processes running), or VS will overwrite the value when you quit! – ashes999 Jan 19 '15 at 20:11
  • 4
    I'm looking for this in VS2017 and nothing is there, under any version folder. – Chris Jul 01 '19 at 18:27
  • 2
    Similar question for VS2019 - where was this setting moved? – David Burg May 12 '21 at 03:12
  • @DavidBurg See https://stackoverflow.com/a/41122603/41071. – svick May 22 '23 at 15:39
5

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.

ldam
  • 4,412
  • 6
  • 45
  • 76
0

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.

ARS one -
  • 1
  • 1