Skip to content

Missing taskbar icon when Form constructor is delayed by blocking operation #13357

Closed as not planned
@mkarpacts

Description

@mkarpacts

.NET version

.NET Framework 4.7.1

Did it work in .NET Framework?

No

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

If a blocking operation (such as Thread.Sleep) is placed in the constructor of a form before the call to InitializeComponent(), and this operation takes longer than approximately 5000 milliseconds, the application's icon does not appear in the Windows taskbar until the form is fully initialized.

This creates confusion for users, as they may think the application has not started at all.

I would highly appreciate it if your team could review this behavior and confirm whether it is a known issue or potentially a bug that could be fixed in future versions of WinForms.

For your information, this issue has been reproduced on the following operating system:
OS Name: Microsoft Windows 11 Pro
Version: 10.0.26100 Build 26100

Steps to reproduce

I have prepared a minimal WinForms application to demonstrate this behavior. The code includes two constants:

  • 4000 ms – the icon appears correctly
  • 5000 ms – the icon does not appear

You can switch between them in Form1.cs to observe the difference.

I’ve attached a ZIP

WinFormsTaskbarBugDemo.zip

archive with the full project and a README file explaining the steps to reproduce the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions