简体   繁体   English

如何防止Visual Studio中断SignalR集线器中引发的异常?

[英]How to prevent Visual Studio from breaking on exception thrown in SignalR hub?

I am developing a SignalR application and when something wrong happens during a SignalR call from client, I would like to propagate the exception back to the client. 我正在开发SignalR应用程序,当从客户端调用SignalR时发生错误时,我想将异常传播回客户端。 However, instead of sending the exception right back to the client, Visual Studio breaks on: 但是,Visual Studio不会将异常直接发送回客户端,而是会中断:

HubException was unhandled by user code

If I hit F5 to continue, the exception correctly propagates back to the client. 如果我按F5键继续,则异常会正确传播回客户端。

Is there a way to teach Visual Studio to just ignore certain classes of exceptions during hub execution? 有没有一种方法可以教Visual Studio在中心执行过程中忽略某些类的异常?

This solution does not work - it catches other exceptions, but VS still breaks on the HubException: How to NOT breaking on an exception? 该解决方案不起作用-它捕获了其他异常,但是VS仍然在HubException上中断: 如何不中断异常?

in a code window pres CTRL + D E to open the Exceptions window -> Add -> enter HubException and uncheck Thrown and User-unhandeled 在代码窗口PRES CTRL + d E打开例外窗口- >添加- >输入HubException和取消抛出 用户unhandeled

在此处输入图片说明

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

相关问题 如何防止 Visual Studio 在更深层次的异常中断后中断所有等待 - How to prevent Visual Studio from breaking on all the awaits after it breaks on a deeper level Exception 阻止 Visual Studio 打破任务中的异常 - Stop Visual Studio from breaking on exception in Tasks 阻止Visual Studio调试打破明显的“未处理的异常” - Prevent Visual Studio debugging breaking on an apparent “unhandled exception” 从任何Xamarin(Visual Studio 2017)android活动向MessageR集线器发送消息 - Send message to SignalR hub from any Xamarin (Visual Studio 2017) android activity 如何摆脱Visual Studio设计器抛出的“Out of memory”异常? - How can I get rid of “Out of memory” exception thrown from Visual Studio designer? Signalr/Hub 未在 IIS 7 中加载,但在 Visual Studio 中正常工作 - Signalr/Hub not loading in IIS 7 but working correctly in Visual Studio 如何防止从一个 JWT 声明到一个集线器的多个连接 [SignalR,C#] - How to prevent multiple connection from one JWT claim to one hub [SignalR, C#] Visual Studio对TextBox对象抛出的异常 - Exception thrown by Visual Studio regarding TextBox object Visual Studio - 抑制某些“抛出异常”消息 - Visual Studio - suppress certain "Exception thrown" messages 如何从SignalR hub获取IOwinContext? - How to get IOwinContext from SignalR hub?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM