maui
maui copied to clipboard
Throwing in a background thread freezes the UI when debugging
Description
Hi, i'v created a new MAUI project with the simple click the button feature, added a looping background thread throwing rapidely and it freezes the UI (clicking fast on the button does not refresh the count directly) ONLY when in debugging mode and not while in the 'Start without debugging' mode.
I want to know why and how can i make it so that my debugging is not hindered by lots of throws as my complete project is throwing a lot while handling errors and worked flawlessly in WPF before but migrating it to MAUI now lags my UI actions (ONLY when debugging again)
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
8.0.7 SR2
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
Can repro this issue at Windows platform on the latest 17.10.0 Preview 3 (8.0.3/8.0.20).
I can't repro this: https://github.com/drasticactions/MauiRepros/tree/main/MauiThrowTest
https://github.com/dotnet/maui/assets/898335/abf17a95-a574-4739-bccd-4abed3697cba
I believe this is the same code you have above. If you can repro this, can you create an example showing it? What are you exception settings in Visual Studio? Maybe you're handling all thrown exceptions which would then break the app.
Hi @drasticactions and thanks for looking into this. I created another new .net MAUI App with .net8.0 LTS, only copied your MainPage.xaml.cs into mine, and could reproduce on my machine. I also tried disabling all exception handling as seen in this video and it is also lagging the UI only when debugging and not when launching without debugging.
https://github.com/dotnet/maui/assets/3333868/8fbd7930-72d9-4afb-9c33-b3c36e94af70
Thanks for the issue report @pmlemay! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.
If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.
- Go to the Visual Studio for Windows feedback tool or Visual Studio for Mac feedback tool to report the issue
- Close this bug, and consider adding a link to the VS Feedback issue so that others can follow its activity there.
Heres the link to the VS Feedback issue https://developercommunity.visualstudio.com/t/Throwing-in-a-background-thread-freezes/10639803?port=1025&fsid=a1c74860-94ec-4935-872e-50c704e06239
@pmlemay I reopened this since it was punted back to this repo, but I still can't repro your issue. If you could create a repro project that can show this, that will help. Also if you could try this within VSCode with the MAUI extension to see if it happens there (if not, maybe it is still something in VS, or else maybe it's a debugger issue, or something within MAUI although IMO based on the looks of it, I doubt it at the moment)..