Comments (5)
Is this for ASP.NET Core or ASP.NET Web API? It's hard to tell. It looks like it might be ASP.NET Core due to the services
variable name, so I'll roll with that assumption.
Starting in 6.0
, all of the API Versioning features hang off of IApiVersioningBuilder
. This centralizes configuration in a consistent way. The change is documented in the migration guide.
It's not clear if you only have Minimal APIs or you also have controllers. Regardless, the configuration is nearly identical:
var builder = WebApplication.CreateBuilder( args );
var services = builder.Services;
services.AddApiVersioning() // Core API Versioning services with support for Minimal APIs
.AddMvc() // API version-aware extensions for MVC Core with controllers (not full MVC)
.AddApiExplorer() // API version-aware API Explorer extensions
The API Explorer extensions are included in Asp.Versioning.Mvc.ApiExplorer. The old extension method was AddVersionedApiExplorer
because it would have otherwise been ambiguous with the built-in AddApiExplorer
. Now that the extension methods all hang off of IApiVersioningBuilder
, the names can be more succinct and are unambiguous.
from aspnet-api-versioning.
Sorry for not being more specific. It's for ASP.NET Core Web API.
from aspnet-api-versioning.
No worries. I figured as much. ASP.NET Web API runs on the ASP.NET (4.x) Classic stack using the .NET Framework. You can, however, build a web API on ASP.NET Core, which runs on .NET. They are both ASP.NET and you can build web APIs with them both. API Versioning supports them both. 90%+ of the time people mean ASP.NET Core, but every once in a while, a question or issue comes up about the old stack, so I like to clarify. Thanks MS Marketing for making things unambiguously easy to understand! 😵💫
Hopefully, that solution works for you.
from aspnet-api-versioning.
I got one more question. In the Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer I was using "IApiVersionDescriptionProvider". Is there any alternatives for this in Asp.Versioning?
I tried installing Asp.Versioning.WebApi, but do I need Asp.Versioning.Mvc as well?
from aspnet-api-versioning.
Solved this! Figured out that I needed to use Asp.Versioning.Mvc and not the Asp.Versioning.WebApi!
@commonsensesoftware Thanks for helping out with the other stuff! I'll close this issue! 😄
from aspnet-api-versioning.
Related Issues (20)
- Problem with describing reponse codes in minimal api HOT 3
- Cannot run APIs with different controller names with same ControllerName attribute after migration HOT 6
- Different options in `ApiVersioningOptions.cs` between .NET Framework and .NET Core packages HOT 2
- WithOpenApi() ignore Api versioning readers HOT 4
- .net 8 support HOT 7
- Breaking changes when migrating to OData8 + new versioning HOT 10
- odata/$metadata returns 404 when all controllers are decorated with ApiVersionNeutralAttribute HOT 3
- VersionedApiDescriptionProvider does not set the correct SunsetPolicy to ApiDescription instances HOT 1
- Using ApiExplorerSettingsAttribute together with ApiVersionAttribute produces unexpected number of ApiVersionDescriptions HOT 5
- Asp.Net Core WebApi - AWS ECS Cluster Authentication failure HOT 2
- [Versioned Clients][API Notifications] Fails to read new versions when available HOT 2
- Swashbuckle documentation inconsistent with examples HOT 2
- AssumeDefaultVersionWhenUnspecified does not work correctly if ApiVersionNeutral is used in the controller HOT 2
- swagger.json file not found after update HOT 9
- My API is not displaying all the versions. HOT 4
- Improve docs for HeaderApiVersionReader
- Add synonym to `AddMvc` method. HOT 7
- CurrentImplementationApiVersionSelector behaves differently based on whether an operation still exists on latest API version HOT 3
- The error 'code' is not included in the error response when using AddErrorObjects() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aspnet-api-versioning.