-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Step Over sometimes executes a lot more than one statement #109885
Comments
Tagging subscribers to this area: @tommcdon |
I have this bug too. For me hot reload also doesn't work in dot net 9 More info: |
Ya. Debugging really sucks in .NET 9.0 right now. If I had to guess, it was added to 10.x as a matter of policy, but I'm about 100% certain that once everybody gets back from holiday (and enough people complain here), this will be approved for servicing pretty quickly. |
Same here |
I have the same issue. It happens all the time and is very tricky. I cannot debug effectively currently. |
Wait what. Is this not going to be fixed anytime soon? Do you have a source? |
This bug is genuinely unworkable for me. When pressing F10, it keeps going significantly further than what I want. I am trying to debug geometrical algorithms. I can only do this when I know exactly where I am in this process. It is impossible to do when it goes all over the place. I am trying to combat this by putting a breakpoint every other line, but this is simply not working. When will this be fixed? |
Why are you still on 9? |
I put a lot of effort into moving all my projects to .NET 9.0 last week. I need it for MAUI Blazor Hybrid. It is not possible for me to go back. Have been looking forward to .NET 9.0 for a long time. |
I also continue to have try-catches that are not catching errors. Is this also a .NET 9.0 thing? |
Hello all! Our workflow is to fix issues in main, then backport to servicing as needed. Since this issue applies to both to main (.NET 10) and .NET 9, we put the issue in the .NET 10 milestone. Once we have a fix for the problem, we plan to backport a servicing-friendly version of it to .NET 9. |
Hello @Woudjee! This sounds like a different problem. Please feel free to open a new github issue to track it. |
Thank you for your reply. That makes sense! In your experience, how much time does it usually take for these kinds of issues to be resolved? A week? A month? A quarter? Then I can somewhat anticipate on this during my work the upcoming period 👍 |
Thank you for explaining this, |
Disabling CET in the project file seems to help in my case. <CETCompat>false</CETCompat> |
@f2bo if that solves this, I consider it a solution. But what does it mean? I’ll try it out next week. 👍👍 |
I don't know if this is the solution but I noticed that single-stepping appears to behave normally once you apply this setting, at least in my case and after a very quick test. I thought I'd mention it here and see what other people's experience is. I posted simple repro steps here, in case anyone wants to give it a try.
|
@f2bo of course I understand. It’s more a temporary workaround than an actual solution. But if it - for now - allows me to debug, that’s immensely valuable. I read the section you highlighted. For the software that I am currently developing I believe it’s fine to turn it off. I will let you know my findings later next week. |
Reactivated for backport to 9.0 |
@tommcdon I see that you've identified the cause. Just out of curiosity, did this turn out to be related to CET or does disabling it only mask out the problem? I couldn't tell from the PR. I should mention that after disabling it, I haven't seen a single failure whereas previously I could almost never complete a debugging session without an incident. |
As far as we understood during our tests with CET enabled would cause the race condition, between the APC call and the stepping on debugger, happens more frequently, that is why disabling the CET you didn't get the problem anymore. |
Well done for figuring it out 👍 when do you expect us to be able to update to the version which contains this fix in .NET 9.0? |
@thaystg Got it. Thanks! |
I am really hoping a .NET 9.0.1 lands today and includes this fix. |
We have addressed the bug in an upcoming patch release. I'll update this issue when the patch has been released. Thanks for reporting it! |
Good work. I had 2 issues: this one and i also noticed hot reload not working (no errors, just no code updates). |
Fixed via #110533 |
I have something similar. I have a web api project that sometimes throws a C# compiler error after changing some code and pressing hot reload. This happens sporadically, I don't have any clear order of steps to reproduce this. Happens to me maybe once per workday. |
Is there a manual download or other action required to retrieve the fix? |
@Woudjee It is labeled for milestone 9.0.2 so it should be included in the next upcoming service release of .NET 9 |
Ah good one. After reading your message, I managed to find that as well. Currently the 9.0.2 milestone is 72% completed so that’s looking promising 👍 |
Description
When I'm debugging code, I use F10 (Step Over) to walk through one line of code at a time.
In .NET 8x, this worked fine.
In .NET 9x, sometimes it seems like it runs a TON more code until it hits a breakpoint.
I suspect I might be running into some variant of #109785 and I specifically notice this happening in ForEach code as described in #109812 .
I see this is slated to be fixed in .NET 10.0, however, this is a major annoyance and I am very hopeful this will be approved for servicing.
Reproduction Steps
Not sure.
Expected behavior
"Step Over" works like .NET 8.0
Actual behavior
"Step Over" sometimes works like "Continue"
Regression?
Yes.
Known Workarounds
Use .NET 8.0
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: