Relate to versioning system for asp.net api. Provides a set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core.
Questions tagged [aspnet-api-versioning]
49 questions
53
votes
3 answers
What is AddEndpointsApiExplorer in ASP.NET Core 6
I'm upgrading an ASP.NET Core API project from v5 to v6.
Service config in v5:
services.AddSwaggerGen();
Service config in v6:
builder.Services.AddEndpointsApiExplorer(); // what is this?
builder.Services.AddSwaggerGen();
What is…

lonix
- 14,255
- 23
- 85
- 176
4
votes
1 answer
Is it possible to use AspNet Api Versioning with Net 6 Minimal APIs?
I am using Net 6 Minimal APIs:
application.MapGet("countries", async (IService service) => {
var countries = await mediator.Send(request);
return Results.Ok(countries);
});
Is it possible to use AspNet Api Versioning with Net 6 Minimal APIs?…

Miguel Moura
- 36,732
- 85
- 259
- 481
4
votes
1 answer
NSwag and multiple api versions
Consider controllers below:
namespace Web.Controllers
{
[ApiVersioning("1.0")
[Route("api/v{version:apiVersion}/[controller]")]
public class Product : ApiController
{
[HttpGet("id")]
public IHttpActionResult…

Ali Bahrami
- 5,935
- 3
- 34
- 53
4
votes
2 answers
How to add "Content-Type = application/json;v=2.0" including versioning with HttpClient?
Sorry to ask this question like this. I can give you the feeling I would like you to do the code for me. I already spent a day tying to write the code to send a http request that contains a header with versioning:
For versioning I use the versioning…

Bastien Vandamme
- 17,659
- 30
- 118
- 200
3
votes
1 answer
The type or namespace name 'ApiVersionDescription' could not be found (are you missing a using directive or an assembly reference?)
I already added the package of Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer, but I'm still getting this error. Is anyone have an idea on how to resolve this issue?Thank you in advance.
Reference:…

jayz
- 31
- 2
3
votes
1 answer
Cannot disable the default API versioner when upgrading from .NET Core 2.2 to 3.1
I'm currently going through the process of upgrading from 2.2 to 3.1.
In doing so .NET's default api-versioner is running along side ours despite adding the code to remove this:
Is there a new way to register a custom versioner or is there a new…

Wilcko
- 158
- 8
3
votes
1 answer
ASP.NET Core API Versioning - Partially supplant previous method version
I'm having an issue with API Versioning (ASP.NET Core API 2.1). I'm trying to supplant one method of an existing controller without having to copy all of the methods in the previous version. I assumed this would work but it gives me a problem with…

Rebecca
- 13,914
- 10
- 95
- 136
3
votes
4 answers
Web-Api versioning with URL c#
I'm struggling for days now, i'm trying to achieve my API to version with the url suffix.
f.e. http://localhost/api/v1/sites & http://localhost/api/v2/sites.
I was pretty close I guess but suddenly I messed it all up..
Many thanks for helping me…

Gregory
- 149
- 2
- 5
- 13
2
votes
2 answers
Does anyone have a working example of AspNetCore .Net 6 + Swashbuckle + OData Web API
Does anyone have a working example of AspNetCore Web API with:
.Net 6
OData (including $batch)
Swashbuckle
versioning (api/v1,api/v2,etc)

Roman Gudkov
- 3,503
- 2
- 20
- 20
2
votes
1 answer
API Versioning in .NET Core - AssumeDefaultVersionWhenUnspecified
I'm looking into adding versioning to an existing API we have. We are embedding the version in the URL.
The requirement for the versioning is that it should be easy to add a new version, but not everything changes and we don't want to go through all…

Michael Pedersen
- 91
- 2
- 8
2
votes
1 answer
Removing part of the URL paths when generating swagger JSON files using SwashBuckle for versioned API's
I have a .NET Core Web API with versioning in place. There are 2 versions currently, and the operation paths in the 2 swagger files look something like:
/api/v1/Versioning/List (v1 swagger)
/api/v2/Versioning/List (v2 swagger)
There is a build…

Reinder Wit
- 6,490
- 1
- 25
- 36
2
votes
2 answers
Web API 2 versioning with Microsoft.AspNet.WebApi.Versioning
I am using ASP.NET Versioning Library, I have followed steps to add this library to a very basic ASP.NET Web API 2 project, Here are the contents of my files:
Global.asax file:
public class WebApiApplication : System.Web.HttpApplication
{
…

Rathma
- 1,196
- 2
- 33
- 65
2
votes
3 answers
How to retrieve list of all implemented versions of my api?
I'm using aspnet-api-versioning in my WebApi project and it works fine. Versions are not hardcoded, they are retrieved from the namespaces.
Now I would like to retrieve the list of already implemented versions. I want to create some endpoint (let's…

Marta
- 326
- 4
- 11
1
vote
1 answer
ASP.NET Core: versioning dependency injection in Program.cs
I have been trying to implement versioning in my ASP.NET Core 6.0 Web API using Microsoft.AspNetCore.Mvc.Versioning.
I want to use separate v1 and v2 folders for my versions:
Controllers
- v1
- MyController
- v2
- MyController
However,…

Scottish Smile
- 455
- 7
- 22
1
vote
1 answer
Asp.Versioning.Http AmbiguousMatchException: The request matched multiple endpoints on controllers
I am trying to achieve header based versioning on my controllers with Asp.Versioning.Http package version 6.4.0
it is supposed to be super simple here however i get AmbiguousMatchException: The request matched multiple endpoints exception
Here is my…

TheSlowestDev
- 35
- 2