I think MvcApplication is a global singleton. I want to get the instance of MvcApplication in the controller. Then I put the following code in controll
MvcApplication
Try this:
var app = HttpContext.Current.ApplicationInstance as MvcApplication;