Closed shawnwildermuth closed 5 years ago
If the MVC compatibility version is set to 2.1 or lower then it is not on by default. This is what the default MVC template includes when an MVC project is created. By choosing to set the compatibility flag to 2.2 (or latest) you're opting into the latest features, and that means accepting that when you upgrade you may need to change your application to work with the latest MVC features.
If you use a library that builds on the old routing system you will need to disable endpoint routing (there is an explicit flag - MvcOptions.EnableEndpointRouting) until the library supports it.
This isn't what I'm getting in Preview2. A new mvc project (dotnet new mvc) has:
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
That is what a new 2.2 project will generate. It isn't a breaking change if it is a brand new project! 😄
A 2.1 project will have CompatibilityVersion.Version_2_1
so upgrading to the latest NuGet packages will not automatically enable endpoint routing. The developer must choose to do it.
We're on the same page then.
We've had a few discussions with @commonsensesoftware about this already. Many of the details of the new system works are based on his feedback.. I'm sure we'll work with him to get a release of API versioning that supports the new stuff.
Cool, I'm going to see if I can help him with a PR, so we'll have something works by 2.2
Closing this since its answered
I'm trying to get my head around the Endpoint routing. I understand why you're introducing it, but it looks like it's going to break some major things (for me, it's /Microsoft/aspnet-api-versioning). I can turn off Endpoint routing, but I am hoping to get some opinions about how we should teach it to new students.
The preview1 announcement makes this interesting pronoucement (emphasis mine):
Do you mean that Endpoint routing will include a versioning story, or do you mean that aspnet-api-versioning will be updated to support it? I ask this as it doesn't sound like aspnet-api-versioning will be ready (except with the case where we turn off Endpoint routing for 2.2). Can anyone confirm this so I can plan. Here is the post where I talked to the aspnet-api-versioning folks: