How to break on exception in rider Follow Answered Alex Bespaluy Created August 25, 2016 13:42 Hi, guys, how to break on exception in Rider, it is not implemented yet?
A month has passed, and still no answer. Rider Team, it's strongly required feature. We just want to know is it in the plans or not.If you do not understand what is meant, I will explain. Sometimes in the depths of our applications some exception raised. And sometimes I want to fix it. I have to debug the code, watch local variables in the place where exception thrown. Currently to do it I have to catch exception, analyze stack trace (which is long text), find the code with 'throw' and place break-point. It would be better if Rider stops the application as if there is break point on 'throw' code line. Similar feature in VS really helps us.
Yes, we're working on break on exception.
Thank you, Matt. This is good news for everyone!
Any update on this?
You may press "View Brakepoints" and add an Exception Brakepoint.
We have an issue to improve the Usability and Discoverability for this feature.
This still doesn't work for me. I don't understand.
I've created a simple example where I create a list and then attempt to access an item in an empty list.
When I run the program, it runs and then stops and it never shows me what the exception was.
I have to write my code in Rider and then go to Visual Studio to run it.
@Mastuh8 do you run your application or debug it?
@Ivan Oh man.. that was it. I forgot that VS runs it in Debug by default.
Toggling Exception Breakpoints in the "View Breakpoints " section absolutely does not work in Rider version 2018.1.3. I have a test running against my service which causes an Optimistic Concurrency error. Debugging in VSCode works fine. Debugging in Rider simply logs the exception to the log and nothing more. This is unacceptable, especially for a paid product like Rider, when a free product like VSCode works out of the box.
I tried to reproduce your problem in 2018.1.3, but without success.
Could you please check if the setting "Settings/Build, Execution & Deployment / Break on User unhandled exception" is enabled.
In 2018.1.3 Exception Breakpoints don't work for me either and I have "Settings/Build, Execution & Deployment / Break on User unhandled exception" enabled.
Exception Breakpoints are broken.
Hi, Brian, Oliver,
Sorry for the late answer.
If you debug an ASP .NET Web App here is a known issue. I hope, it will be fixed in the nearest updates.
As a workaround, you need to add any exception to the list of breakpoints in the "View breakpoints" window.
With that setting, debugger will break on an exception in case of Web app.
If that is not your case, could you please clarify the operating system and the type of project you tried to debug?
No, ASP.NET is not the use case. I am using Rider on MacOS (latest version) while debugging a Unity (ver 2018.2.1f1) project. I can send you more details/dump log upon request and maybe a video of the issue happening if it helps. Visual Studio on Mac stops at exceptions without any issues.
On Windows, Rider stops at System exceptions but not at custom ones (like UniyEngine.UnassignedReferenceException) - but I guess it's ok for now as it is being stated in the settings (.NET only)
I had the same issue. Exception breakpoints did not trigger. I found out that after I enabled "Break on unhandled exception", the exception-breakpoints worked.
Hi, I am new to Rider, coming from VS. Cool that I can turn on "Break on ....", I would really suggest that it is on by default, when you install. It has been very confusing debugging without the "Break on ..." until now.
Thank you for an otherwise brilliant product.
I have a similar issue, while debugging a selfhosted web api.
JetBrains Rider 2018.3.1
Build #RD-183.5253.26, built on December 26, 2018
Licensed to Rider Evaluator
Expiration date: February 8, 2019
JRE: 1.8.0_152-release-1343-b26 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
Just to prove that I understood the feature right:
When using a exception breakpoint the execution will stop even on handled exceptions right?
It't been a while.
Any updates to this topic?
Bump. This is really horrid behaviour, you know. Having to dig through a 1500-line stack trace to find the one line in my code where the exception is thrown is... nerve wracking.
Hello POWELEIT Georg!
Please, try to reproduce the problem on Rider 2019.1. If it still persists, please, create a support request via https://rider-support.jetbrains.com/hc/en-us/requests/new?ticket_form_id=97145 and attach Rider logs (Help | Compress Logs and Show in ...).
I am on 2019.1, it's still an issue as of yesterday, and why do you need a new ticket when you already have a perfectly good three-year-old one sitting here?
The application gets into a state where it won't break on exceptions, and you can't get it out of that state. You've got plenty of people here telling you that.
This is with all of the "break on exception" options checked.
Also I'm not sure how useful the logs will be. Rider logs the exception, it just doesn't freaking break on it.
Happens to me too
I truly understand your disappointment. It is very frustrating to have this problem so long.
But we cannot diagnose it without any data. So, Shaim, Stefan, Georg, please try Rider 2019.1.3 and share the following:
1. your project type
2. enable Debugger tracing in "Help | Trace Scenarios (LOGS)," reproduce the issue and share all logs with us "Help | Compress Logs and Show in ..." (disable tracing after all)
3. a screenshot of "View Breakpoints" window (check that [Enabled] and [Suspend] checkboxes are ticked for "Any Exceptions")
4. a screenshot of "Preferences | Build, Execution, Deployment | Debugger."
5. a code example would be incredibly useful.
I've created an issue. So, please attach all the data there.
Thank you in advance!
A link to you provided doesn't work. There is 404 message. Probably you made a typo. Could you please provide a correct one?
I also have the same problem, and I will be happy to share my logs with you.
Thanks for letting me know about that.
Please, try now.
Happens to me too. Rider 2019.2.3, Web API 2 project, .net v4.5
Please, update your Rider to the latest 2019.3.1 version, open your solution, enable Debugger tracing in Help | Log Trace Scenarios, reproduce the issue collect logs from Help | Compress Logs and Show in Explorer (disable tracing after all).
Attach all logs to the new support request via `Help | Contact support` or create a YouTrack issue via `Help | Report a bug`. Please do not forget to add both screenshots and details about your project.
Thank you in advance!
Please report it with Help->Report a Bug, agree to attach logs. @Benc Rockstar
I was dreaded with this horrible bug for a week.
Going to Run -> Stop On Exception... -> Searching for System.Exception -> Press OK(Ivan Shakhov, can you provide some feedback that something actually happens here? Currently the window just closes).
That fixed it for me. Hope it helps someone else. What Rider actually does on the confirmation is not shown/displayed, but it works, now so :joy:
Hey! Not sure what feedback I can give. If UI works unexpectedly at some place, please create a bug report with Help->Report a Bug, attach screencast/screenshot.