-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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. |
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 👍 |
I know that you cannot give a "release date" for the fix, but can you at least provide a ballpark/approximate release? This is really causing headaches when trying to debug. |
In the meanwhile, use CETCOMPAT = true or = false. It is a workaround that triggers this issue almost never. I have been using it since the beginning of this issue and have been able to be productive with it. If you Google it I’m certain you’ll find it somewhere! |
I tried each setting in all of the projects and neither setting solved the intermittent issue. I hope a fix is released soon - this is a big problem. |
I saw that .NET 9.0.1 was released yesterday. I couldn't find any of the issues mentioned or the PR for the fix included in the Release Notes - maybe I just missed it - but I decided to look in the Release branch for the fix and was relieved to find that the fix was included in the .NET 9.0.1 Release! |
@udlose that is awesome news! |
Can someone above report back if this version is working for you? |
UPDATE: this is in fact NOT fixed in .NET 9.0.102 :( |
@udlose I haven't updated yet but are you sure this is the right place to look? I also noticed that it wasn't mentioned in the release notes, nor here. Furthermore, the milestone for the servicing PR is labeled 9.0.2. |
How do I update? By simply updating using Visual Studio Installer? |
I hadn't noticed it was labeled as 9.0.2 milestone. I'm not familiar with the branching strategy that MS uses but I do also see the fix included in the |
VS Installer was what I used. It updated me to VS2022 v17.12.4. If you look at the .NET Downloads page you can see it says 9.0.102 is included in the latest VS version: ![]() |
Since it is intermittent, it is possible that the fix wasn't included in 9.0.1 and is in fact scheduled for 9.0.2 as @f2bo points out above and I just haven't experienced it yet. I'll update this thread if I experience the bug again. |
After some focused debugging, I can confirm that I misspoke and the issue was not included in .NET 9.0.102 :( - apparently I just hadn't hit the intermittent issue yet. My optimism took over lol - I guess we have to wait until 9.0.2 (and I guess the |
@udlose I understand that disabling CET didn't work in your case. I suppose that since the issue is caused by a race condition, not every environment behaves in the same way. But for other people having this problem, I would suggest trying |
This program should trigger easily the debug bug.
|
This article seems to indicate that this bug is resolved but I am still running into it with VS 17.12.4 with .NET 9.0.1. |
Supposedly fixed for 9.0.2 (as yet unreleased). This issue was 'closed' so I have to believe it's imminent. Really looking forward to having my debugger back to normal, lol |
Based on their release cadence, I'd expect the fix to be available within the next 2 months or so. |
come on MICROSOFT , I can't even debug my hello world ........... dotnet --version |
Adding this to my project made things work in the interim:
|
I have dozen of projects that I'd rather not doctor up for this purpose when hopefully the next release will take care of it. I have been using the little green continue-to-here button that appears to the left of all executable code during debugging. It's not quite as useful as the breakpoints, but it does allow you to control the code execution better than the current state of breakpoints does. |
The fix for this issue has shipped in 9.0.2 - available from https://dotnet.microsoft.com/en-us/download/dotnet/9.0. |
can someone confirm this version is fixed and stable? |
At least it fixed the example I sent, and exceptions in other threads do not cause the bug anymore. |
I can at least confirm it seems to have addressed it on the surface. I haven't noticed the behavior since updating. |
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: