Why is ASP.NET MVC Authorize attribute throwing a null reference exception?

Posted by robertz on Stack Overflow See other posts from Stack Overflow or by robertz
Published on 2010-05-19T14:03:59Z Indexed on 2010/05/21 1:10 UTC
Read the original article Hit count: 822

Filed under:
|

I had a working asp.net mvc application running on my local IIS 7 web server, but now I'm getting errors whenever I request a page that requires authorization. I'm using standard forms authentication with asp.net membership. Here's the error:

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] System.Web.Mvc.AuthorizeAttribute.AuthorizeCore(HttpContextBase httpContext) +31 System.Web.Mvc.AuthorizeAttribute.OnAuthorization(AuthorizationContext filterContext) +38 System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) +103 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +345...

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc