AddVersionedApiExplorer Extension missing
See original GitHub issuei tried to configure aspnet api versioning as follow ASP.NET Core Versioned API Explorer
so i added following nuget packages
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="2.2.0" />
but compiler complain
Severity Code Description Project File Line Suppression State Error CS1929 ‘IServiceCollection’ does not contain a definition for ‘AddVersionedApiExplorer’ and the best extension method overload ‘IServiceCollectionExtensions.AddVersionedApiExplorer(IMvcCoreBuilder, Action<ApiExplorerOptions>)’ requires a receiver of type ‘IMvcCoreBuilder’
on this line
services.AddVersionedApiExplorer( o => o.GroupNameFormat = “'v’VVV” );
have you removed AddVersionedApiExplorer
method ? or any issue on my configuration ?
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
AddVersionedApiExplorer Extension missing · Issue #330
i tried to configure aspnet api versioning as follow ASP.NET Core Versioned API Explorer so i added following nuget packages.
Read more >c# - iServiceCollection' does not contain a definition for ' ...
Solution: AddVersionedApiExplore lives in Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer NuGet package.
Read more >Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer 5.1.0
This package contains the API version-aware extensions for API Explorer in ASP.NET Core, which are useful in a number of scenarios such as...
Read more >Creating .NET Core API with versioning
A versioning allows clients to continue using the existing REST API and migrate their applications to the newer API when they are ready....
Read more >ASP.NET 6.0 - Swagger API versioning - Mark Gossa
Introduction. In this post, we'll talk through how we can add API versions to the Swagger page using ASP.NET 6.0.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In version 2.x.x, the setup is
services.AddMvcCore().AddVersionedApiExplorer()
, but in version 3.x.x+ it has the simplified form ofservices.AddVersionedApiExplorer()
. Sorry about the confusion. I haven’t had enough time to fully update the wiki to call out these differences.I don’t think so, but what are you trying to achieve?
services.AddMvc()
always implicitly callsservices.AddMvcCore()
on your behalf. The point of having it hang off ofAddMvcCore
is to support scenarios where the entire MVC stack is not being used (e.g. no UI/APIs only). Starting in v3.0 (currently beta), the setup will simply beservices.AddVersionedApiExplorer()
and the required underlying services will be setup for you.