In one of our ASP.NET MVC applications, we have enabled email notification/DB logging on exceptions. When we promoted the application from Staging to Production, we started getting exceptions for our Logout action. The exception used to look like this:
Message: A public action method ‘Logout’ was not found on controller ‘MyMvcApp.Web.Controllers.AccountController’.
at System.Web.Mvc.Controller.HandleUnknownAction(String actionName)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I searched all placed in my code but couldn’t find what is going wrong. Finally – got the help from following thread on Stackoverflow:
I tried both web.config setting to deny verbs and removing the [HttpGet] attribute from the action – both works fine.