dotnet / dotnet/winforms

[Application Builder] Establish the WinForms host and application lifetime

Open
#14,940 0 comments 0 reactions 0 assignees View on GitHub
Review Issue
Dominant language
C#
Stars
4.9k
Forks
1.1k
Avg merge
20h 23m
Merged PRs (30d)
103

Description

## User story

As a WinForms developer, I want a first-class application builder and host lifetime so that startup, the UI thread, application context, and graceful shutdown follow modern .NET conventions without hiding WinForms' desktop semantics.

## Rationale and user benefit

This is the foundation for the remaining Application Builder work. It should align with the Generic Host and existing proposal #11415 while retaining predictable `Application.Run`, `ApplicationContext`, synchronization-context, exception, and shutdown behavior.

## Scope boundary

Own the core builder, built application, options, host/lifetime integration, UI-thread startup, application context, startup-form activation, and graceful shutdown contracts. Coordinate public contracts with the DI/scopes and services/configuration stories, but do not implement their internal features here.

## Acceptance criteria

- [ ] C# and VB can configure, build, run, and stop the same application model.
- [ ] Startup form and custom `ApplicationContext` scenarios are supported.
- [ ] UI-thread and synchronization-context behavior is explicit and deterministic.
- [ ] Host and WinForms shutdown signals propagate correctly in both directions.
- [ ] Existing `Application.Run` applications remain supported and source compatible.
- [ ] The relationship with #11415 is resolved without competing lifetime models.

## Definition of Done

- [ ] API shape and ownership boundaries are reviewed.
- [ ] Runtime implementation, automated tests, samples, diagnostics, and compatibility documentation are complete.
- [ ] Startup/shutdown failure paths, resource cleanup, performance, and accessibility implications are validated.
- [ ] CI passes on supported architectures.

## Parallelization

This is foundation stream A. Stabilize the minimum shared contracts early so streams B and C can work against them without editing the same implementation areas.

Contributor guide

Open the contributing guide

Research direction

Start by reading proposal #11415 and the existing Application.Run and ApplicationContext behavior referenced in the issue. Define the shared builder, host, lifetime, startup-form, and shutdown contracts before coordinating with the DI/scopes and services/configuration work. Done means reviewed API boundaries, implementation, tests, samples, diagnostics, compatibility documentation, and passing CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.