MSMP 2 Value can not be null: actionDescriptor

Jun 22, 2010 at 10:25 PM
Playing around with MvcSiteMapProvider 2 today, and have come across an issue. On one of my actions, I was getting this error: [ArgumentNullException: Value cannot be null. Parameter name: actionDescriptor] System.Web.Mvc.AuthorizationContext..ctor(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +220 MvcSiteMapProvider.AuthorizeAttributeAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\AuthorizeAttributeAclModule.cs:88 MvcSiteMapProvider.DefaultAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultAclModule.cs:61 MvcSiteMapProvider.DefaultSiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs:108 System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +491 MvcSiteMapProvider.DefaultSiteMapProvider.FindControllerActionNode(SiteMapNode rootNode, IDictionary`2 values) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs:643 MvcSiteMapProvider.DefaultSiteMapProvider.FindControllerActionNode(SiteMapNode rootNode, IDictionary`2 values) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs:661 MvcSiteMapProvider.DefaultSiteMapProvider.FindControllerActionNode(SiteMapNode rootNode, IDictionary`2 values) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs:661 MvcSiteMapProvider.DefaultSiteMapProvider.FindSiteMapNode(HttpContext context) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\DefaultSiteMapProvider.cs:609 System.Web.SiteMapProvider.get_CurrentNode() +69 MvcSiteMapProvider.Web.Html.SiteMapTitleHelper.SiteMapTitle(MvcSiteMapHtmlHelper helper) in C:\Projects\TFS10.CODEPLEX.COM\mvcsitemap\Main\MvcSiteMapProvider\MvcSiteMapProvider\Web\Html\SiteMapTitleHelper.cs:25 ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Projects\STEP Handbook\src\STEP.Website\Views\Shared\Site.Master:6 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +131 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +246 System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer) +85 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5274 The issue turned out to be that my XML file had a sitemap node defined that no longer existed. Is this expected behavior, and if so, can we document it somewhere in case anyone else runs into this?
Jun 26, 2010 at 3:38 PM

I also get this and it is really annoying because you don't know what node is causing the error.

MvcSiteMap should be changed to either...

a. Don't throw an error when a node refers to an action that doesn't exist or,

b. include in the error message which node is causing the error

Coordinator
Jun 30, 2010 at 12:53 PM

Will be fixed in 2.1.0.