Skip to content
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

SetCompatibilityVersion(CompatibilityVersion.Version_2_2) causes routing error #252

Closed
yecli opened this issue Apr 30, 2019 · 3 comments
Closed
Assignees

Comments

@yecli
Copy link
Contributor

yecli commented Apr 30, 2019

Changing MVC application compatibility version to 2.2 SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
causes following error:
InvalidOperationException: Cannot use 'VirtoCommerce.Storefront.Routing.SlugRoute' with Endpoint Routing.
Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action configureRoutes)

InvalidOperationException: Cannot use 'VirtoCommerce.Storefront.Routing.SlugRoute' with Endpoint Routing.
Microsoft.AspNetCore.Builder.MvcApplicationBuilderExtensions.UseMvc(IApplicationBuilder app, Action configureRoutes)
VirtoCommerce.Storefront.Startup.Configure(IApplicationBuilder app, IHostingEnvironment env) in Startup.cs

Technical details:
kobake/AspNetCore.RouteAnalyzer#19

Need to remove specific ASP.NET.Core versions from csproj files.

@yecli yecli added this to the Operations milestone Apr 30, 2019
@AliveMen
Copy link
Contributor

AliveMen commented May 7, 2019

Any implementing IRouter is currently not compatible with endpoint routing.
dotnet/aspnetcore#4221
and recommended to use services.AddMvc(options => options.EnableEndpointRouting = false)
Instead of this we can use default Route type and linkGenerator
https://devblogs.microsoft.com/aspnet/asp-net-core-2-2-0-preview1-endpoint-routing/

@yecli
Copy link
Contributor Author

yecli commented May 7, 2019

Current PR fixes the problem, so it could be merged.
But indeed we need to add Middleware with LinkGenerator like in link above to implement MapSlugRoute functionality to switch to 2.2 routing system.

@yecli
Copy link
Contributor Author

yecli commented Jun 4, 2019

Released in v3.2.10.

@yecli yecli closed this as completed Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants