I am getting a blank page while deploying MVC application on IIS

You will also get a blank page when you have error handling setup in your global.asax and something generic is wrong (like an assembly that could not be found).

When you disable it in the global.asax, you can see the server error.
Don’t forget to enable it again after fixing those initial bugs.

protected void Application_Error(object sender, EventArgs e)
{
    Exception exception = Server.GetLastError();
    RouteData routeData = new RouteData();
    routeData.Values.Add("controller", "ErrorController");
    routeData.Values.Add("action", "HandleTheError");
    routeData.Values.Add("error", exception);

    Response.Clear();
    Server.ClearError();

    IController errorController = new ErrorController();
    errorController.Execute(new RequestContext(
        new HttpContextWrapper(Context), routeData));
}

Leave a Comment