Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

The generic host documentation presents two configuration patterns in tabbed examples without explaining the differences or selection criteria, leaving readers to guess which approach to use.

Changes

  • Added "Host builder options" section before "Set up a host" explaining:

    • IHostApplicationBuilder (.NET 6+): Linear, property-based configuration via builder.Services, builder.Configuration
    • IHostBuilder (legacy): Callback-based configuration via ConfigureServices, ConfigureAppConfiguration
  • Selection criteria: Use IHostApplicationBuilder for new projects (current default). Use IHostBuilder for existing codebases or third-party library compatibility.

The new section provides context immediately before readers encounter the first tabbed code examples, clarifying that both approaches have identical functionality and defaults despite different configuration styles.

Original prompt

This section details on the original issue you should resolve

<issue_title>Critera for selecting IHostApplicationBuilder vs IHostBuilder should be made clearer</issue_title>
<issue_description>### Type of issue

Missing information

Description

The linked page contains several sets of example code, in tabbed pairs (e.g. in "Set up a host"), but does not seem to contain any information about why one should select one tab or the other.

This is a pretty tricky area to understand as, over time, dotnet has basically used every possible combination of the words "Builder", "Host", "Application" and "Web" (with and without the letter "I") to describe the innumerable different ways of setting up the start of an application.

I think it would be good if, before we got to the first two alternative examples in "Set up a host", it was explained why one would choose IHostApplicationBuilder instead of IHostBuilder. Or, at the least, what the functional difference was between the two examples.

Page URL

https://learn.microsoft.com/en-us/dotnet/core/extensions/generic-host?tabs=appbuilder

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/extensions/generic-host.md

Document Version Independent Id

22a12ff8-d2ff-a841-b9bb-e2fd1032bc04

Platform Id

3b476193-005a-256b-77a1-c15957a55240

Article author

@IEvangelist

Metadata

  • ID: d43ecd7c-307a-688e-d533-c1135bde65f9
  • PlatformId: 3b476193-005a-256b-77a1-c15957a55240
  • Service: dotnet-fundamentals

Related Issues</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Internal previews

📄 File 🔗 Preview link
docs/core/extensions/generic-host.md .NET Generic Host

…ion criteria

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot AI changed the title [WIP] Clarify criteria for selecting IHostApplicationBuilder vs IHostBuilder Add guidance for selecting IHostApplicationBuilder vs IHostBuilder Feb 4, 2026
Copilot AI requested a review from gewarren February 4, 2026 00:32
@gewarren gewarren requested a review from eerhardt February 4, 2026 01:56
@gewarren gewarren marked this pull request as ready for review February 4, 2026 01:56
@gewarren gewarren requested a review from a team as a code owner February 4, 2026 01:56
Copilot AI review requested due to automatic review settings February 4, 2026 01:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #46082 by adding a new "Host builder options" section to the Generic Host documentation. The section explains the differences between IHostApplicationBuilder and IHostBuilder configuration patterns, providing selection criteria that were previously missing.

Changes:

  • Added a new "Host builder options" section explaining the two approaches for configuring a Generic Host
  • Updated the ms.date field to reflect the documentation update

@gewarren gewarren enabled auto-merge (squash) February 4, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Critera for selecting IHostApplicationBuilder vs IHostBuilder should be made clearer

2 participants