Allow dev environments to auto-enable dev-centric features in "slim" host builder
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 281
Description
The new "slim" host builder API (#32485) removes a number of default features that exist to make the development time better. It would be great to allow for the development environment (e.g. Visual Studio, `dotnet run`, `dotnet watch`, etc.) to be able to re-enable these features when launching the application during the development inner-loop experience so that even when using the slim builder these dev-centric features are still enabled when launched from the developer environment.
The features in question:
- User secrets configuration provider
- Debug logger
- IHostingStartup (enables things like the browser refresh middleware to be injected so the browser can be refreshed on code-change, aka Hot Reload)
This could be achieved by adding a new runtime switch that the slim host builder API would check and if enabled would add these features to the host builder. The switch can be set by the launching environment by passing a build property when building the project, e.g. `-p:EnableWebApplicationBuilderDevelopmentFeatures=true` (super bad name but you get the idea).
Contributor guide
Research direction
Start by reading the slim host builder API introduced in issue #32485 and trace how it handles default features. Determine how a development launch could re-enable user secrets, the debug logger, and IHostingStartup through a runtime or build-provided switch. Done means the proposed behavior is defined for Visual Studio, dotnet run, and dotnet watch, with tests covering the development and non-development paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100