UrlHelper ArgumentException

Oct 11, 2009 at 4:39 PM

Getting the following error when trying to use the site map.  Tried a few things just using the sample configuration on the main page.  Using VS2008 SP1.  Anyone ran into this before?  Tried to debug it a little, looks like the RouteValues being passed to UrlHelper has an "action" value that it does not like.

ArgumentException: The provided object or dictionary already contains a definition for 'action'.
Parameter name: actionName]
   System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary valuesDictionary, RouteCollection routeCollection, RequestContext requestContext) +306
   System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary valuesDictionary) +28
   System.Web.Mvc.UrlHelper.Action(String actionName, String controllerName, RouteValueDictionary valuesDictionary) +111
   MvcSiteMap.Core.MvcSiteMapNode.get_Url() in D:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapNode.cs:84
   System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode) +66
   MvcSiteMap.Core.MvcSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode) in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:356
   System.Web.SiteMapProvider.AddNode(SiteMapNode node) +9
   MvcSiteMap.Core.MvcSiteMapProvider.AddNode(SiteMapNode node) in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:336
   MvcSiteMap.Core.MvcSiteMapProvider.BuildSiteMap() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:264

[MvcSiteMapException: An error occured while parsing the SiteMap XML. Check the inner exception for more details.]
   MvcSiteMap.Core.MvcSiteMapProvider.BuildSiteMap() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:299
   MvcSiteMap.Core.MvcSiteMapProvider.GetRootNodeCore() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:365
   System.Web.SiteMapProvider.get_RootNode() +15
   MvcSiteMap.Core.MvcSiteMapProvider.get_RootNode() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:118
   MvcSiteMap.Core.MvcSiteMapProvider.FindSiteMapNode(HttpContext context) in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:567
   System.Web.SiteMapProvider.get_CurrentNode() +35
   System.Web.SiteMap.get_CurrentNode() +34
   MvcSiteMap.Core.Helpers.SiteMapPathHelper.SiteMapPath(HtmlHelper helper, String separator, String separatorCssClass, String linkCssClass) in D:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\Helpers\SiteMapPathHelper.cs:46
   MvcSiteMap.Core.Helpers.SiteMapPathHelper.SiteMapPath(HtmlHelper helper) in D:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\Helpers\SiteMapPathHelper.cs:22
   ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\Users\Dylan\Documents\Workspace\bierman\bierman.esb\trunk\Bierman.Esb.Web\Views\Shared\Site.Master:184
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +42
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

ArgumentException: The provided object or dictionary already contains a definition for 'action'.
Parameter name: actionName]
   System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary valuesDictionary, RouteCollection routeCollection, RequestContext requestContext) +306
   System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary valuesDictionary) +28
   System.Web.Mvc.UrlHelper.Action(String actionName, String controllerName, RouteValueDictionary valuesDictionary) +111
   MvcSiteMap.Core.MvcSiteMapNode.get_Url() in D:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapNode.cs:84
   System.Web.StaticSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode) +66
   MvcSiteMap.Core.MvcSiteMapProvider.AddNode(SiteMapNode node, SiteMapNode parentNode) in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:356
   System.Web.SiteMapProvider.AddNode(SiteMapNode node) +9
   MvcSiteMap.Core.MvcSiteMapProvider.AddNode(SiteMapNode node) in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:336
   MvcSiteMap.Core.MvcSiteMapProvider.BuildSiteMap() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:264
[MvcSiteMapException: An error occured while parsing the SiteMap XML. Check the inner exception for more details.]
   MvcSiteMap.Core.MvcSiteMapProvider.BuildSiteMap() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:299
   MvcSiteMap.Core.MvcSiteMapProvider.GetRootNodeCore() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:365
   System.Web.SiteMapProvider.get_RootNode() +15
   MvcSiteMap.Core.MvcSiteMapProvider.get_RootNode() in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:118
   MvcSiteMap.Core.MvcSiteMapProvider.FindSiteMapNode(HttpContext context) in d:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\MvcSiteMapProvider.cs:567
   System.Web.SiteMapProvider.get_CurrentNode() +35
   System.Web.SiteMap.get_CurrentNode() +34
   MvcSiteMap.Core.Helpers.SiteMapPathHelper.SiteMapPath(HtmlHelper helper, String separator, String separatorCssClass, String linkCssClass) in D:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\Helpers\SiteMapPathHelper.cs:46
   MvcSiteMap.Core.Helpers.SiteMapPathHelper.SiteMapPath(HtmlHelper helper) in D:\Sources\CP-TFS10\mvcsitemap\Main\MvcSiteMap\MvcSiteMap.Core\Helpers\SiteMapPathHelper.cs:22
   ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in d:\Users\Dylan\Documents\Workspace\bierman\bierman.esb\trunk\Bierman.Esb.Web\Views\Shared\Site.Master:184
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +42
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

 

 

 

Coordinator
Oct 12, 2009 at 8:02 AM

Never seen that one. ARe you trying this on the default project included in MvcSiteMap?

Oct 12, 2009 at 2:20 PM

Sorry about that.  I should have looked at my MVC version.  I had a beta installed.