Skip to content

Add Web API Analyzers deprecation warnings for .NET 10+#37295

Merged
wadepickett merged 6 commits into
mainfrom
copilot/add-warning-for-web-api-analyzers
Jun 26, 2026
Merged

Add Web API Analyzers deprecation warnings for .NET 10+#37295
wadepickett merged 6 commits into
mainfrom
copilot/add-warning-for-web-api-analyzers

Conversation

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #37193

Update based on example suggested drafts by wadepickett in the issue.

Web API Analyzers (IncludeOpenAPIAnalyzers MSBuild property and associated MVC API analyzers) were deprecated in .NET 10 and will be removed in a future release, but the relevant docs had no indication of this.

Changes

  • web-api/advanced/analyzers.md — Added [!WARNING] callout after H1, moniker-gated to >= aspnetcore-10.0. Mentions ASPDEPR007 build warning and recommends migrating to TypedResults.
  • web-api/advanced/conventions.md — Same treatment; conventions rely on these analyzers.
  • fundamentals/openapi/includes/include-metadata10.md — Added [!WARNING] after the "enable Web API analyzers" link. File is already scoped to = aspnetcore-10.0, so no additional moniker guard needed.
  • fundamentals/openapi/include-metadata.md — Added [!WARNING] after the same link inside the existing >= aspnetcore-11.0 moniker range.

include-metadata9.md is intentionally unchanged — deprecation does not apply to .NET 9.

Example of the warning added to analyzers.md:

:::moniker range=">= aspnetcore-10.0"

> [!WARNING]
> The `IncludeOpenAPIAnalyzers` MSBuild property and its associated MVC API analyzers are **deprecated** as of .NET 10 and will be removed in a future release. When `IncludeOpenAPIAnalyzers` is set to `true`, the build emits warning `ASPDEPR007`. Migrate to the <xref:Microsoft.AspNetCore.Http.TypedResults> pattern, which provides compile-time response-type guarantees without separate analyzers. For more information, see [IncludeOpenAPIAnalyzers property and MVC API analyzers are deprecated](/aspnet/core/breaking-changes/10/openapi-analyzers-deprecated?view=aspnetcore-10.0).

:::moniker-end

Internal previews

📄 File 🔗 Preview link
aspnetcore/fundamentals/openapi/include-metadata.md Include OpenAPI metadata in an ASP.NET Core app
aspnetcore/web-api/advanced/analyzers.md Use web API analyzers
aspnetcore/web-api/advanced/conventions.md Use web API conventions

Copilot AI added 2 commits June 25, 2026 20:51
- Add WARNING callout in analyzers.md after H1 (for >= aspnetcore-10.0)
- Add WARNING callout in conventions.md after H1 (for >= aspnetcore-10.0)
- Add WARNING callout in include-metadata10.md near 'enable Web API analyzers' link
- Add WARNING callout in include-metadata.md (>= aspnetcore-11.0) near 'enable Web API analyzers' link
- Update ms.date in analyzers.md and conventions.md

Fixes #37193
Copilot AI changed the title [WIP] Add warning for deprecated Web API analyzers in .NET 10 Add Web API Analyzers deprecation warnings for .NET 10+ Jun 25, 2026
Copilot AI requested a review from wadepickett June 25, 2026 20:53
@wadepickett wadepickett marked this pull request as ready for review June 25, 2026 20:58
Comment thread aspnetcore/web-api/advanced/analyzers.md Outdated
Comment thread aspnetcore/web-api/advanced/conventions.md Outdated
Comment thread aspnetcore/fundamentals/openapi/include-metadata.md Outdated
@wadepickett

Copy link
Copy Markdown
Contributor

@mikekistler & @tdykstra for review.

@mikekistler mikekistler 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.

Looks great! 👍

Thank you!

@wadepickett wadepickett merged commit f0a1a99 into main Jun 26, 2026
4 checks passed
@wadepickett wadepickett deleted the copilot/add-warning-for-web-api-analyzers branch June 26, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web API Analyzers were deprecated in .NET 10

3 participants