|
| 1 | +--- |
| 2 | +title: "Breaking change - Microsoft.Extensions.ApiDescription.Client package deprecated" |
| 3 | +description: "Learn about the breaking change in ASP.NET Core 10 where the Microsoft.Extensions.ApiDescription.Client package has been deprecated." |
| 4 | +ms.date: 08/07/2025 |
| 5 | +ai-usage: ai-assisted |
| 6 | +ms.custom: https://github.com/aspnet/Announcements/issues/518 |
| 7 | +--- |
| 8 | + |
| 9 | +# Microsoft.Extensions.ApiDescription.Client package deprecated |
| 10 | + |
| 11 | +The Microsoft.Extensions.ApiDescription.Client NuGet package has been deprecated. The package supplied MSBuild targets and CLI support that generated OpenAPI-based client code during the build. Projects that reference the package now receive a warning during build. |
| 12 | + |
| 13 | +## Version introduced |
| 14 | + |
| 15 | +.NET 10 Preview 7 |
| 16 | + |
| 17 | +## Previous behavior |
| 18 | + |
| 19 | +Projects could add `<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" ... />` and `<OpenApiReference>` items (or run `dotnet openapi`) to generate strongly typed clients at build time. |
| 20 | + |
| 21 | +```xml |
| 22 | +<Project Sdk="Microsoft.NET.Sdk"> |
| 23 | + <PropertyGroup> |
| 24 | + <TargetFramework>net10.0</TargetFramework> |
| 25 | + </PropertyGroup> |
| 26 | + |
| 27 | + <ItemGroup> |
| 28 | + <PackageReference Include="Microsoft.Extensions.ApiDescription.Client" Version="8.0.0" /> |
| 29 | + </ItemGroup> |
| 30 | + |
| 31 | + <ItemGroup> |
| 32 | + <OpenApiReference Include="swagger.json" /> |
| 33 | + </ItemGroup> |
| 34 | +</Project> |
| 35 | +``` |
| 36 | + |
| 37 | +## New behavior |
| 38 | + |
| 39 | +The package is now deprecated and projects that reference it receive build warnings. The MSBuild targets and CLI commands are no longer supported. |
| 40 | + |
| 41 | +## Type of breaking change |
| 42 | + |
| 43 | +This change can affect [source compatibility](../../categories.md#source-compatibility). |
| 44 | + |
| 45 | +## Reason for change |
| 46 | + |
| 47 | +- The package has seen minimal updates and maintenance since its introduction. |
| 48 | +- Its abstractions were tightly coupled to certain generators and did not scale well to others. Each generator now ships its own CLI/configuration experience, making the MSBuild middle-layer redundant. |
| 49 | +- Removing the package reduces maintenance burden and clarifies the recommended workflow for client generation. |
| 50 | + |
| 51 | +## Recommended action |
| 52 | + |
| 53 | +- Remove any `<PackageReference Include="Microsoft.Extensions.ApiDescription.Client" … />` from your project. |
| 54 | +- Replace `<OpenApiReference>` items or `dotnet openapi` commands with generator-specific tooling: |
| 55 | + - NSwag – Use `npx nswag` or `dotnet tool run nswag` with an `.nswag` config file. |
| 56 | + - Kiota – Install with `dotnet tool install -g Microsoft.OpenApi.Kiota` and run `kiota generate`. |
| 57 | + - OpenAPI generator – Invoke `openapi-generator-cli` via JAR or Docker. |
| 58 | +- Commit the generated client code or run generation in a custom pre-build step that doesn't rely on the removed package. |
| 59 | + |
| 60 | +## Affected APIs |
| 61 | + |
| 62 | +- MSBuild item `OpenApiReference` (all instances). |
| 63 | +- MSBuild property `OpenApiProjectReference`. |
| 64 | +- CLI command [`dotnet openapi`](/aspnet/core/fundamentals/openapi/openapi-tools). |
0 commit comments