Skip to content

Clarify Microsoft.Extensions.Hosting package prerequisite and version for CreateApplicationBuilder (Fixes #51289) - #56657

Merged
BillWagner merged 2 commits into
dotnet:mainfrom
Manish-1kumar:users/manish/issue-51289-create-application-builder-hosting-prereqs
Dec 1, 2026
Merged

BillWagner merged 2 commits into
dotnet:mainfrom
Manish-1kumar:users/manish/issue-51289-create-application-builder-hosting-prereqs

Conversation

@Manish-1kumar

@Manish-1kumar Manish-1kumar commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #51289

Summary of Changes

  • Explicitly adds the .NET CLI command to install the \Microsoft.Extensions.Hosting\ NuGet package: \dotnet add package Microsoft.Extensions.Hosting.
  • Clarifies that \Host.CreateApplicationBuilder\ was introduced in .NET 7 / \Microsoft.Extensions.Hosting\ 7.0+, avoiding compiler errors for readers targeting earlier versions or missing package references.
  • Notes the alternative \Host.CreateDefaultBuilder\ for projects targeting .NET 6 or earlier and provides cross-references to .NET Generic Host.

Internal previews

File Preview link
docs/core/extensions/configuration.md Learn preview

Build report

@dotnetrepoman dotnetrepoman Bot added this to the November 2026 milestone Nov 1, 2026
@dotnet-policy-service dotnet-policy-service Bot added dotnet-fundamentals/svc community-contribution Indicates PR is created by someone from the .NET community. labels Nov 1, 2026
@BillWagner
BillWagner requested a balanced review from Copilot November 24, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The documentation bases the API fallback on the target framework rather than the hosting package version, incorrectly redirecting .NET 6 users who have Microsoft.Extensions.Hosting 7.0.0.

1 open issue
What changed in this PR

This PR addresses #51289 by clarifying the hosting package prerequisites for the configuration article’s Generic Host example.

Changes:

  • Adds the CLI command to install Microsoft.Extensions.Hosting.
  • Documents the package version required for Host.CreateApplicationBuilder and adds fallback guidance with a Generic Host link.
File Description
docs/​core/​extensions/​configuration.md Expands package setup and API compatibility guidance, and refreshes the article date.

Review effort: Balanced

Comment thread docs/core/extensions/configuration.md Resolved
@Manish-1kumar
Manish-1kumar force-pushed the users/manish/issue-51289-create-application-builder-hosting-prereqs branch from 303b0a6 to 1d9d477 Compare November 30, 2026 17:40

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This LGTM, and I'll :shipit: now.

@BillWagner
BillWagner merged commit cb60b04 into dotnet:main Dec 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UUF] CreateApplicationBuilder is not part of Host

3 participants