question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AddVersionedApiExplorer Extension missing

See original GitHub issue

i 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8

github_iconTop GitHub Comments

29reactions
commonsensesoftwarecommented, Aug 14, 2018

In version 2.x.x, the setup is services.AddMvcCore().AddVersionedApiExplorer(), but in version 3.x.x+ it has the simplified form of services.AddVersionedApiExplorer(). Sorry about the confusion. I haven’t had enough time to fully update the wiki to call out these differences.

1reaction
commonsensesoftwarecommented, Sep 20, 2018

I don’t think so, but what are you trying to achieve? services.AddMvc() always implicitly calls services.AddMvcCore() on your behalf. The point of having it hang off of AddMvcCore 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 be services.AddVersionedApiExplorer() and the required underlying services will be setup for you.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found