This project is read-only.


A parameter is mysteriously appended to url on root of application


All of a sudden today I'm getting an "Area" appended to the query string on the root of my application. It doesn't show up outside of the root. Asp.Net MVC 5 using attribute routing. No default routes are specified at all in my app. All controller actions have a manual route applied using an attribute.

How do I get rid of this extra parameter?
Url.Action(MVC.Product.Detail(x, y, z)) 
produces the following url:
Closed Jan 28, 2015 at 4:10 PM by KevinKuszyk
As part of our move to GitHub, we are closing all the outstanding issues on CodePlex.

If your issue is still valid, please re-open it on GitHub:

Thanks for contributing!


davidebbo wrote Feb 9, 2014 at 9:17 PM

JoeyBradshaw wrote Feb 10, 2014 at 9:47 AM

I don't have any areas. I tried all the suggested fixes and these were the results:
  1. Add dummy Area: fixed the issue on the root page, but severely broke links on all other pages.
  2. Registered a default route (non-attribute based) with an empty value for Area: had no affect on the issue.
        name: "Default",
        url: "{controller}/{action}/{id}",
        defaults: new { controller = "Home", action = "Index", area = "", id = UrlParameter.Optional }
  1. Modified (T4MVC Version 3.7.4): this fixed the issue for me. No artifacts or broken urls on any pages now.
Added the following method to deal with unwanted route values at line 205.
        protected void RemoveRouteValueIfNullOrWhiteSpace(string key, RouteValueDictionary routeValues)
            if (routeValues.ContainsKey(key) && string.IsNullOrWhiteSpace(routeValues[key].ToString()))
Added call to remove empty Area route value at line 355. There may be another spot in the template where this call is needed, but I haven't run into it yet.
    RemoveRouteValueIfNullOrWhiteSpace("Area", callInfo.RouteValueDictionary);
Thanks for pointing me in the right direction.

davidebbo wrote Feb 10, 2014 at 10:30 PM

Can you be more specific how the links were broken when adding a dummy area?