使用Visual Studio立即窗口时超时 [英] Timeout when using Visual Studio immediate window

查看:115
本文介绍了使用Visual Studio立即窗口时超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我尝试在visual studio中使用即时窗口中的缓存,我会得到超时。

我已经做了这个简单的测试场景,在控制台应用程序中重现:


DataCacheServerEndpoint

I get the timeout if I try to use the cache from the immediate window in visual studio.

I have made this simple test scenario, to reproduce in a console app:

DataCacheServerEndpoint

[ ] servers = new DataCacheServerEndpoint [1];

servers [0] =

[] servers = new DataCacheServerEndpoint[1];

servers[0] =

new DataCacheServerEndpoint " hostName" ,22233, " ; cacheHostName" );

new DataCacheServerEndpoint("hostName", 22233, "cacheHostName");

 

DataCacheFactory mycacheFactory = < span style ="color:#2b91af; font-size:x-small"> DataCacheFactory (服务器, true false );

DataCacheFactory mycacheFactory = new DataCacheFactory(servers, true, false);

 

DataCache dataCache = mycacheFactory.GetCache( " cacheName" );

DataCache dataCache = mycacheFactory.GetCache("cacheName");

 

对象 x = dataCache.Get( " test" );

代码运行完美,但如果我在代码的末尾放置一个断点并运行dataCache.Get( " test" )从即时窗口中我得到以下错误。
左{" ErrorCode< ERRCA0023>:SubStatus< ES0001>:请求超时。"}

object x = dataCache.Get("test");

The code runs perfect, but if i put a breakpoint in the end of the code and run dataCache.Get("test") from the immediate window the i get the following error.

{"ErrorCode<ERRCA0023>:SubStatus<ES0001>:The request timed out."}

推荐答案

发生这种情况是因为从CacheServer发送的数据由客户端中的工作线程填充回来。由于调试器冻结了所有线程,因此永远不会填充数据。因此超时。

如果你有localCache中的数据,那么你不会注意到这个问题。
This happens because the data that is sent from the CacheServer is populated back by worker thread in the client. Since the debugger freezes all the threads, the data can never be populated. Hence the timeout.

If you have the data in the localCache then you dont notice the issue.


这篇关于使用Visual Studio立即窗口时超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆