I think MvcApplication is a global singleton. I want to get the instance of MvcApplication in controller. Then I put following code in controller: MvcApplication app = HttpContext.Current.Application as MvcApplication;
it give me error: Error 2 'System.Web.HttpContextBase' does not contain a definition for 'Current' and no extension method 'Current' accepting a first argument of type 'System.Web.HttpContextBase' could be found (are you missing a using directive or an assembly reference?)
Why? How to access MvcApplication in controller?