sitemap broken after converting mvc2 project to mvc3

Feb 4, 2011 at 5:57 AM

i've recently upgraded my project from mvc2 to mvc3 and now my nodes aren't resolving anymore if i don't specify the route or url values on the attribute.
the only thing i have done is upgrade my project. 
the nodes were working perfectly up to the upgrade.
an example attribute :
 [MvcSiteMapNode(Title = "Tag Home", Key = "TagRoot", ParentKey = "SubscriberRoot", AreaName = "Tags")]
this is on the index action on the UserTag controller in the Tags area
i've traced the issue to DefaultSiteMapNodeUrlResolver.cs and the ResolveURL method.
the resolveURL method gets passed the correct info (although the area parameter is never used?)
the routevalues dictionary we're passing in contains the correct keys (controller, action, area) and they have the correct values.
but when we call UrlHelper.Action(action, controller, new RouteValueDictionary(routeValues));
it always returns null and then throws the exception, even though the action is valid and the values are correct?
not quite sure how to debug this. is there something i should be doing differently on mvc3?

Feb 4, 2011 at 7:55 AM

fixed, was a problem with mvc 3 itself.


i had a route with 2 optional parameters set up.


Feb 4, 2011 at 9:40 AM

Good to hear :-)