case 4690 - Asp.Versioning 10.2.1 with explicit AddMvc()

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 18:45:40 -07:00
parent 6f3dda117e
commit e55e0d6707
3 changed files with 6 additions and 4 deletions

View File

@@ -35,8 +35,8 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="10.0.13" />
<!-- <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0" /> -->
<PackageReference Include="Asp.Versioning.Mvc" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="Asp.Versioning.Mvc" Version="10.2.1" />
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="10.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.13" />
<PackageReference Include="Microsoft.Extensions.ApiDescription.Server" Version="10.0.13">

View File

@@ -202,7 +202,8 @@ namespace AyaNova
options.AssumeDefaultVersionWhenUnspecified = true;
options.DefaultApiVersion = new Asp.Versioning.ApiVersion(8, 0);// Asp.Versioning.ApiVersion..Parse("8.0");
options.ReportApiVersions = true;
}).AddApiExplorer(options =>
}).AddMvc()//Asp.Versioning 10: register MVC controller versioning explicitly (as in Sockeye), not only through AddApiExplorer
.AddApiExplorer(options =>
{
// add the versioned api explorer, which also adds IApiVersionDescriptionProvider service