Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.
Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.
Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.
Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.
Created attachment 3123 [details] Example project demonstrating the issue Given routes like this: // Blog home page - Don't include page number in URL for first page routes.MapRoute( name: "BlogHome", url: "blog", defaults: new { controller = "Home", action = "BlogIndex", page = 1 } ); routes.MapRoute( name: "BlogHomePage", url: "blog/page-{page}", defaults: new { controller = "Home", action = "BlogIndex" }, constraints: new { page = @"\d+" } ); Whenever page=1 is used in the route, it should resolve to /blog, and whenever any other number is used, it should resolve to /blog/page-x. That is, the following Razor (.cshtml) view: @Url.Action("BlogIndex", "Home", new { page = 1 }); @Url.Action("BlogIndex", "Home", new { page = 2 }); Should display the following: /blog/page-1 /blog/page-2 This works in Microsoft .NET, but Mono appears to be ignoring the first route and is outputting the following: /blog/page-1 /blog/page-2 Another issue I've encountered is with the following routes: routes.MapRoute( name: "BlogAdminPostsPublished", url: "blog/admin/posts/published", defaults: new { controller = "Home", action = "Posts", published = true } ); routes.MapRoute( name: "BlogAdminPostsUnpublished", url: "blog/admin/posts/unpublished", defaults: new { controller = "Home", action = "Posts", published = false } ); UrlHelper.Action is not using these routes in Mono - The following: @Url.Action("Posts", "Home", new { published = true }) @Url.Action("Posts", "Home", new { published = false }) Should output this: /blog/admin/posts/published /blog/admin/posts/unpublished But it is outputting this: /Home/Posts?published=True /Home/Posts?published=False I've attached a test project which demonstrates this issue. This app runs under Mono 3.0 (via XSP) and on Windows via IIS or Cassini.
Sorry, for the first one, I meant that the output should be as follows: /blog /blog/page-2
I've fixed this but Github is currently down. I'll submit my fix as a pull request once Github is up again.
Patch submitted via Github: https://github.com/mono/mono/pull/526