Skip to content

Add deprecation warning to Microsoft.Extensions.ApiDescription.Client MSBuild package #62646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 10, 2025

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 9, 2025

This PR adds a compile-time deprecation warning to the Microsoft.Extensions.ApiDescription.Client MSBuild package to inform users that the package is deprecated and will be removed in a future release.

Changes Made

  • Added a deprecation warning target to build/Microsoft.Extensions.ApiDescription.Client.props
  • The warning appears during restore, build, and compile phases for any project that references this package
  • Works for both single-targeting and multi-targeting scenarios
  • Preserves all existing MSBuild functionality

Warning Message

When developers build projects that reference this package, they will now see:

warning : The 'Microsoft.Extensions.ApiDescription.Client' package is deprecated and will be removed in a future release. Please consider migrating to alternative solutions for OpenAPI client code generation.

Implementation Details

The warning is implemented as an MSBuild target that executes before the BeforeCompile, Build, and Restore targets:

<Target Name="_WarnMicrosoftExtensionsApiDescriptionClientDeprecated" BeforeTargets="BeforeCompile;Build;Restore">
  <Warning Text="The 'Microsoft.Extensions.ApiDescription.Client' package is deprecated and will be removed in a future release. Please consider migrating to alternative solutions for OpenAPI client code generation." />
</Target>

Testing

  • Verified the warning appears correctly during build for both single-target and multi-target projects
  • Confirmed all existing MSBuild tasks and properties continue to work as expected
  • The warning does not break the build process (it's a warning, not an error)

This change provides clear communication to developers about the package's deprecation status while maintaining backward compatibility.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Open a PR that updates the MSBuild in @dotnet/aspnetcore/files/src/Tools/Extensions.ApiDescription.Client/src to emit a compile-time warning that indicates that the package is deprecated and will be removed in a future release. Add deprecation warning to Microsoft.Extensions.ApiDescription.Client MSBuild package Jul 9, 2025
@Copilot Copilot AI requested a review from captainsafia July 9, 2025 23:27
Copilot finished work on behalf of captainsafia July 9, 2025 23:27
@Copilot Copilot AI requested a review from captainsafia July 10, 2025 00:09
Copilot finished work on behalf of captainsafia July 10, 2025 00:09
Copilot finished work on behalf of captainsafia July 10, 2025 00:15
@captainsafia captainsafia marked this pull request as ready for review July 10, 2025 02:26

<!-- Emit deprecation warning for this package -->
<Target Name="_WarnMicrosoftExtensionsApiDescriptionClientDeprecated" BeforeTargets="BeforeCompile;Build;Restore">
<Warning Code="ASPDEPR001" Text="The 'Microsoft.Extensions.ApiDescription.Client' package is deprecated and will be removed in a future release." HelpLink="https://aka.ms/aspnet/deprecate/001" />
Copy link
Member

Choose a reason for hiding this comment

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

Just verifying, this can be suppressed with <NoWarn>$(NoWarn);ASPDEPR001</NoWarn> in the project file, right?

Copy link
Member

Choose a reason for hiding this comment

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

Yep -- NoWarn will work now that we have a code for this.

@captainsafia captainsafia merged commit 31e0db6 into main Jul 10, 2025
28 checks passed
@captainsafia captainsafia deleted the copilot/fix-72fd5980-5a43-499a-af16-c19015aa9ef3 branch July 10, 2025 22:40
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-preview7 milestone Jul 10, 2025
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.

4 participants