-
Notifications
You must be signed in to change notification settings - Fork 709
'IServiceCollection' does not contain a definition for 'AddApiVersioning' #432
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
Comments
You won't be able to use 3.1+ on ASP.NET Core 2.1 as it specifically targets 2.2. You probalby want to go back to 3.0. The only real difference between 3.0 and 3.1 is that 3.0 still targets 2.0, which allows you to use any version of ASP.NET Core 2.0+. 3.1 adds support for the Endpoint Routing feature in ASP.NET Core 2.2. To use this feature, you obviously need to use 2.2+. The two easily solutions are:
I hope that helps. |
Awesome! Thank you for this info... |
Console Application / Service - serviceProvider fails to get GetService this afternoon. Works perfectly in another console application with the exact same code in it...wonder why ? :-P |
@OneGenkiGirl73 Which service are you requesting? Is there something else about your configuration you can share? |
There was nothing special about it, just a simple "controller" I called an ISiteController that does CRUD for a datatable. In the console application on my home computer it works perfectly. I would think the serviceProvider.GetService would work just the same, because the code is literally an exact replica of the working code in the other console application. |
Sounds like something else is awry. Are you saying if you remove the call to |
I'm sorry, I meant to say the .GetService isn't working as it does with the other database controller I built on my other dev machine. I'm just wondering why the behavior would be different on the other machine with the exact same code...?
Sent from Yahoo Mail on Android
On Wed, Apr 15, 2020 at 9:39 PM, Chris Martinez<notifications@github.com> wrote:
Sounds like something else is awry. Are you saying if you remove the call to services.AddApiVersioning(), then things work as normal?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I tried to add ApiVersioning in ConfigureServices() method but got an error:
'IServiceCollection' does not contain a definition for 'AddApiVersioning' and no accessible extension method 'AddApiVersioning' accepting a first argument of type 'IServiceCollection' could be found...
Tried to install package Microsoft.AspNetCore.Mvc.Versioning 3.1.1 get new error:
Using .Net Core 2.1.1
What am i missing?!
The text was updated successfully, but these errors were encountered: