English 中文(简体)
MVCSiteMapProvider在无物体的情况下坠毁
原标题:MVCSiteMapProvider crashed with null object

我正在利用MvcSiteMapvider为我的网站创造菜单。 它的工作是适当的,但突然失败:

系统: 反对不指标的。

这里的痕迹是:

[NullReferenceException: Object reference not set to an instance of an object.]

MvcSiteMapProvider.AuthorizeAttributeAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) in c:ProjectsCodeplexTFS10mvcsitemapBranches3.1.0srcMvcSiteMapProviderMvcSiteMapProviderAuthorizeAttributeAclModule.cs:80
   MvcSiteMapProvider.DefaultAclModule.IsAccessibleToUser(IControllerTypeResolver controllerTypeResolver, DefaultSiteMapProvider provider, HttpContext context, SiteMapNode node) in c:ProjectsCodeplexTFS10mvcsitemapBranches3.1.0srcMvcSiteMapProviderMvcSiteMapProviderDefaultAclModule.cs:61
   MvcSiteMapProvider.DefaultSiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) in c:ProjectsCodeplexTFS10mvcsitemapBranches3.1.0srcMvcSiteMapProviderMvcSiteMapProviderDefaultSiteMapProvider.cs:178
   System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) +17
   System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +378
   System.Web.SiteMapNode.get_ChildNodes() +30
   System.Web.SiteMapNode.get_HasChildNodes() +10
   MvcSiteMapProvider.Web.Html.MenuHelper.BuildModel(MvcSiteMapHtmlHelper helper, SiteMapNode startingNode, Boolean startingNodeInChildLevel, Boolean showStartingNode, Int32 maxDepth, Boolean drillDownToCurrent) in c:ProjectsCodeplexTFS10mvcsitemapBranches3.1.0srcMvcSiteMapProviderMvcSiteMapProviderWebHtmlMenuHelper.cs:293
   MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper, String templateName, SiteMapNode startingNode, Boolean startingNodeInChildLevel, Boolean showStartingNode, Int32 maxDepth, Boolean drillDownToCurrent) in c:ProjectsCodeplexTFS10mvcsitemapBranches3.1.0srcMvcSiteMapProviderMvcSiteMapProviderWebHtmlMenuHelper.cs:234
   MvcSiteMapProvider.Web.Html.MenuHelper.Menu(MvcSiteMapHtmlHelper helper) in c:ProjectsCodeplexTFS10mvcsitemapBranches3.1.0srcMvcSiteMapProviderMvcSiteMapProviderWebHtmlMenuHelper.cs:31

我不能想到我为引入这一错误所作的任何改动。 作出的唯一变化是使用风格Cop(例如改变使用、方法、财产等顺序)的结果。 任何想法?

最佳回答

如果你不需要安全分类(例如,准许节点/圆点)在网站地图提供者的登记上设定安全干扰。 不应再犯这一错误。

I ve在。 但这不是你的问题。

问题回答

暂无回答




相关问题
Using jquery to get a partial view and updating the UI

I need to render a partial view (returned from the controller) to show some customer summary details. This will need to happen when the user clicks on a button. In the the mean time the user can ...

MVC 2 / MVC 3 / MVC 4

MVC 2 我们可以轻松地创造领域。 现在,我的问题涉及nes地区(地区内)。

Asp.Net MVC 2 - Changing the PropertyValueRequired string

Using a resx file in the App_GlobalResources directory, I ve been able to change the default message for the PropertyValueInvalid string of the model validators. But it doesn t work to translate the ...

ASP.NET MVC 3 - What features do you want to see? [closed]

I know a bunch of people that are really enjoying the improvements that ASP.NET MVC 2 made over the first release. I have just started to migrate our MVC 1 project over and so far areas has totally ...

热门标签