简体   繁体   中英

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. However, instead of sending the exception right back to the client, Visual Studio breaks on:

HubException was unhandled by user code

If I hit F5 to continue, the exception correctly propagates back to the client.

Is there a way to teach Visual Studio to just ignore certain classes of exceptions during hub execution?

This solution does not work - it catches other exceptions, but VS still breaks on the HubException: How to NOT breaking on an exception?

in a code window pres CTRL + D E to open the Exceptions window -> Add -> enter HubException and uncheck Thrown and User-unhandeled

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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