maartenba/MvcSiteMapProvider — Issue #9: url rewrite and mvcsitemap causing Exception...sometimes
Author: joaocarlosleme
Created: 2012-01-05 01:25:50+00:00
State: open

I'm using IIS URL Rewrite to rewrite "/about" to "/home/about". On Mvc.sitemap I'm using:

I all works fine for a while and after an hour or two I get:

System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

@Html.MvcSiteMap().Menu(false, true, true)

Then I have to recycle AppPool on IIS and it all works fine again...for a while.

Any ideas? Thanks in advance.

Stack Trace:

[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
System.Web.Util.UrlPath.ReduceVirtualPath(String path) +11495983
System.Web.Util.UrlPath.Reduce(String path) +171
System.Web.VirtualPath.Combine(VirtualPath relativePath) +214
System.Web.VirtualPathUtility.Combine(String basePath, String relativePath) +158
System.Web.Mvc.PathHelpers.GenerateClientUrlInternal(HttpContextBase httpContext, String contentPath) +385
System.Web.Mvc.UrlHelper.GenerateUrl(String routeName, String actionName, String controllerName, RouteValueDictionary routeValues, RouteCollection routeCollection, RequestContext requestContext, Boolean includeImplicitMvcValues) +257
MvcSiteMapProvider.DefaultSiteMapNodeUrlResolver.ResolveUrl(MvcSiteMapNode mvcSiteMapNode, String area, String controller, String action, IDictionary`2 routeValues) +1034
MvcSiteMapProvider.MvcSiteMapNode.get_Url() +323
MvcSiteMapProvider.AuthorizeAttributeAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) +135
MvcSiteMapProvider.DefaultAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) +216
MvcSiteMapProvider.DefaultSiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) +349
MvcSiteMapProvider.Web.Html.MenuHelper.BuildModel(MvcSiteMapHtmlHelper helper, SiteMapNode startingNode, Boolean startingNodeInChildLevel, Boolean showStartingNode, Int32 maxDepth, Boolean drillDownToCurrent) +361
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, String templateName, SiteMapNode startingNode, Boolean startingNodeInChildLevel, Boolean showStartingNode, Int32 maxDepth, Boolean drillDownToCurrent) +87
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, SiteMapNode startingNode, Boolean startingNodeInChildLevel, Boolean showStartingNode, Int32 maxDepth, Boolean drillDownToContent) +40
MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, Boolean startFromCurrentNode, Boolean startingNodeInChildLevel, Boolean showStartingNode) +86
ASP._Page_Views_Shared__SfMaster_cshtml.Execute() in c:\webmaster\projects\jclcorp\jclcorpmvc\Views\Shared\_SfMaster.cshtml:22
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +280
System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +104
System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +173
System.Web.WebPages.WebPageBase.Write(HelperResult result) +89
System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +234
System.Web.WebPages.WebPageBase.PopContext() +222
System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +384
System.Web.Mvc.<>c__DisplayClass1c.b__19() +33
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +798756
System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +798832
System.Web.Mvc.Controller.ExecuteCore() +159
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
System.Web.Mvc.<>c__DisplayClassb.b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.b__0() +20
System.Web.Mvc.<>c__DisplayClasse.b__d() +54
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225