[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.Mvc.Infrastructure.Implementation.ControllerAuthorization.IsAccessibleToUser(RequestContext requestContext, String controllerName, String actionName, RouteValueDictionary routeValues) +105
Telerik.Web.Mvc.Infrastructure.Implementation.NavigationItemAuthorization.IsAccessibleToUser(RequestContext requestContext, INavigatable navigationItem) +218
The menu worked prior to the upgrade. It fails on approximately 10% of our controllers. Some actions with a route value of {area = ""} work and some fail. Some controller actions within a single controller work and others fail. I cannot find anything to differentiate the ones that succeed and the ones that do not. The level of menu nesting does not appear to be a factor.
This looks to be similar to the issue reported here: LINK
11 Answers, 1 is accepted
ActionDescriptor actionDescriptor = controllerDescriptor.FindAction(controllerContext, actionName);
if (actionDescriptor == null)
{
return null;
}
This is confusing because, by default, if you leave the area off, I always assumed it searched with the current area for matching controllers. That does not appear to be the case. That means, if you have a name conflict between controller classes in different areas, you should specify the area name as part of your route values.
My two suggestions are:
1. Return a reasonable error message when no action is found. String.Format("Area:{0} Controller:{1} Action:{2}", areaName, controllerName, actionName); would have just saved me three hours of work.
2. Default the areaName to be the current area if a specific areaName is not specified. This is the intuitive approach for someone working from the aspx side of things only.
This is a known issue, which is already addressed. You can download the latest internal build, which includes the fix. Please excuse us for the temporary inconvenience this may cause you.
The exception will be thrown, when the authorizationContext object used in the ControllerAuthorization.IsAccessibleUser is null. For now we decided to avoid throwing exception when the authorization context is null. if other users request such functionality (as the suggested one) we will schedule it for implementation.
As to the second suggestions, the menu is a navigational component and it should be able to navigate between different areas. Hence, I believe that it should not default to the current AreaName. If the area is not defined that the menu should navigate to default controller defined with controllerName argument. This is current behavior.
Georgi Krustev
the Telerik team
The internal builds are available to commercial license holders. If your company is a paying customer please ask the person who made the purchase to add you as a licensed developer.
Regards,Atanas Korchev
the Telerik team
When will this fix be available to the Open Source community?
Best Regards,
Emily
The next official release is not yet scheduled. I am sending you the file which contains the fix. Replace the existing one in Telerik.Web.Mvc\Infrastructure\Implementation.
Regards,Atanas Korchev
the Telerik team
> The next official release is not yet scheduled.
I presume that that the next version will be released in 3 months (as it's usually done). Why should the community (open-source) wait 3 months (!!!) just to get a fix for the critical issue. I'm sure that Telerik team should release the new version (open-source) which addresses this issue in the near time. Otherwise, 50% of developers won't be able to use it and can move to some other frameworks.
The update policy of the open source license of Telerik Extensions for ASP.NET MVC is clearly stated on our web site.
Despite that I've already attached the updated C# file so open source users can have the fix. Why can't you use the attached file?
Atanas Korchev
the Telerik team
Use the the Url method instead of the Action method
e.g. Url(Url.Action("actionName","controllerName",new {area="YourArea"}))
It works for me
Since Kendo replaced the ASP.NET MVC Extension, I can't find the latest internal build that contains the fix for this error. I built a whole project with the old MVC extension and I won't upgrade it to Kendo. Can you tell me how I could get the fix for this? Thanks in advance.
Boris