wpf
wpf copied to clipboard
Application icon appears blank/generic if the loaded event is processing background task
Setup for WPF App:
Set Project settings icon location:
After running the wpf app, the icon on the taskbar is blank.
Note this does not occur on Windows 10
Here is a link to an article describing a similar issue after the latest update: https://learn.microsoft.com/en-us/answers/questions/2201775/windows-forms-application-icon-suddenly-shows-as-d
We're trying to fix an issue where the icon randomly disappears though the behaviour is difficult to replicate seeing as this only happens ever so often.
That is not a background task, you are putting main UI thread to sleep, effectively causing the app to hang.
@miloush Apologies, I should have added more detail e.g. the fact that it does not exhibit this behaviour on Windows 10.
fix async MainWindow_Loaded(object sender, RoutedEventArgs s) { await Task.Delay(1000); }
Thank you for creating this issue, we are experiencing the same issue sporadically for several months now, but we weren't able to find the root cause. Having this information helps us to mitigate the problem. Still I would agree that this is a regression in the taskbar process.
We are also experiencing the same issue.
Doing work on the UI thread breaks the icon in certain events. ie loaded.
I've managed to replicate on the loaded event of any control within the main window as well.
I could also replicate doing work on the activated event of the window.
I didn't dig too much on what else breaks, but doing work on the UI thread for as low as 500ms breaks things.
We have a very large Silverlight project ported to WPF and have bad events all over the shop.
I'm trying to track down which event on which control is causing our issues. Since its pretty random for us at least it's tough to find the culprit
While we are replicating on the loaded event, it doesn't mean it's not being caused by a large chunky style. (i'll try give this idea a bash)
If there any contacts within the Microsoft windows team to escalate this with them.
We can "fix" it by setting the icon again.
We can't replicate the same issue on windows 10.
If the reason is that the application is unresponsive, I guess OS can decide how it wants to indicate this to user (such as washed out UI). Or is the issue that once you become responsive again, the icon does not restore?
Does this happen for non-WPF apps? Because I am not sure what could WPF do here. You can report Windows issues using Windows Feedback.
Does this happen for non-WPF apps?
@miloush Yes, I can find this issues in the NSIS installer application.