Visual Studio例外限制 [英] Visual Studio exceptions limit

查看:103
本文介绍了Visual Studio例外限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个抛出各种异常的服务,我也有一个测试客户端来测试所抛出的异常.但是,Visual Studio似乎在9个异常后挂起.我正在调试模式下运行客户端,我想继续这样做,而不会导致Visual Studio在9个异常后挂起.

Hi everybody,
I have a service that throws various kinds of exceptions and I also have a test client to test the exceptions being thrown. However, Visual studio seems to hang after 9 exceptions. I am running the client in the debug mode and I'd like to continue doing so without causing Visual Studio to hang after 9 exceptions. Any help is greatly appriciated.

推荐答案

不,Visual Studio调试器能够处理的异常没有任何限制.也许您遇到了一个已知问题.您能否提供更多其他信息.
1.您是在呼叫Web服务还是Windows服务?2.您的客户端是多线程控制台应用程序吗?这里描述了一个已知问题: http://blogs.msdn.com/jimgries/pages /visual-studio-debugger-faq.aspx

我的多线程控制台应用程序使用Web服务.当我在调试器下启动它时,它不起作用,只是挂在对Web Service的调用上.当我在调试器之外启动它时,一切都很好.发生了什么事?

No, there is certainly no exception limit that Visual Studio debugger is able to process. Perhaps you're running into one of the known issue. Could you provide some more additional information.
1. Are you calling a Web Service or a windows service?
2. Is your client a multi-threaded console application? There's a known issue described here: http://blogs.msdn.com/jimgries/pages/visual-studio-debugger-faq.aspx

My multi-threaded console application makes use of a Web Service.  When I launch it under the debugger it doesn't work, and simply hangs on the call into the Web Service.  When I launch it outside of the debugger everything is fine.  What's going on?

如果您的应用程序在Console.ReadKey/ReadLine中被阻止,则它们会遇到已知的调试器问题.幸运的是,有一个简单的解决方法.从main方法中删除"[STAThread]"属性.从技术角度来看,这样做还是正确的做法,因为STA线程必须泵送消息,否则可能发生资源泄漏.这是由于COM互操作的工作方式.

3.是否安装了Microsoft语言工具栏(高级文本服务)?如果是这样,可能会导致挂起.请在此处查看: http://social.msdn .microsoft.com/forums/zh-CN/vsdebug/thread/7c5ffa6b-7499-470f-ae67-89ad06e10e6e/有关此问题的更多说明.

If your application is blocked in Console.ReadKey/ReadLine then they are running into a known a debugger problem.  Fortunately, there is an easy work-around.  Remove the ‘[STAThread]’ attribute from the main method.  From a technical standpoint, doing this is the right thing to do anyway since STA threads must pump messages, otherwise resource leaks can occur.  This is due to the way COM interop works.

3. Do you have Microsoft Language Toolbar (Advanced Text Services) installed? If so it can cause a hang. Please see here: http://social.msdn.microsoft.com/forums/en-US/vsdebug/thread/7c5ffa6b-7499-470f-ae67-89ad06e10e6e/ for more explanation of this problem.


这篇关于Visual Studio例外限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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