简体   繁体   English

如何避免Visual Studio调试器可视化程序超时?

[英]How to keep Visual Studio debugger visualizers from timing out?

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() 我已经成功制作了多个Visual Studio调试器可视化程序,它们运行得很好,除了在某些对象上尝试使用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. 超时发生得非常快(大约在我单击可视化器图标后大约一秒钟),即使我的某些其他可视化器也可以正常工作,即使大型数据对象的显示时间更长(5-10秒),但仍然无法超时。

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

我认为这没有记录,但是您可以尝试更改上述注册表项中的某些超时,然后重新启动Visual Studio。

I was recently hit by this in VS2012 and after googling I found this : 我最近在VS2012中受到此攻击,在谷歌搜索后发现了这一点

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. 在VS调试器中,每个表达式评估窗口(例如监视窗口,本地窗口,数据提示,自动窗口等)具有不同的默认最大表达式评估超时值。 For datatip, we prefer to give a short time out value because otherwise it will provide a poor user expression. 对于datatip,我们希望提供一个较短的超时值,因为否则将提供较差的用户表达。 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. 如果您确实想摆脱datatip中的该超时,则可以尝试增加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. 超时值是“ DataTipTimeout”注册表项中的一项设置,位于以下位置:HKEY_CURRENT_USER \\ Software \\ Microsoft \\ VisualStudio \\ 10.0 \\ Debugger注:您应针对64位OS探测WOW64Node。 You can also see other windows' default timeout value under this key. 您还可以在此键下查看其他窗口的默认超时值。

要使Visual Studio调试器正常工作-在“ WPF可视化工具”中的“本地”窗口(在WPF应用程序中经过测试),您需要在注册表中找到:HKEY_CURRENT_USER \\ Software \\ Microsoft \\ VisualStudio \\ 12.0 \\ Debugger \\ DWORD参数“ LocalsTimeout”和默认值(1000)设置为足够大的值,例如5000。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM