Attribute routing seems to have introduced breaking changes in 5.1

Topics: ASP.NET MVC
Mar 28, 2014 at 12:37 AM
I threw up a question on stackoverflow about this issue but it's not getting much attention.

I'm seeing different behavior between MVC 5.0 and 5.1 attribute routing. Urls are generated as expected in 5.0 but in 5.1 they are not.

I created two sample applications that are identical except one is mvc 5.0 and the other is 5.1 over here. Hoping some one can clue me into why this occuring.

In this sample project I'm appending a placeholder called {culture} to all routes. When you hover over the About link in the top navigation bar the url should be localhost/en/about but instead its just localhost/about in the 5.1 project. If you manually type in the expected url localhost/en/about you get a 404 error.

The 5.0 project works as expected and outputs localhost/en/about.
Mar 28, 2014 at 5:33 PM
Found the root cause. This is a breaking change in 5.1. See the explanation.