Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.net MVC on IIS 7 returning blank page

I'm having some trouble deploying an ASP.net MVC 2 RC 2 application to my production box. I have it working well in both dev and test. The key difference seems to be that the production box has not yet been upgraded to IIS 7.5. When I go to the site I just get a blank page as is described in I am getting a blank page while deploying MVC application on IIS.

I've tried most things listed there without avail. I have tried using both the integrated and classic configurations for .net 4 and tried going to a specific controller and action just in case it was something to do with the default file. What I did try that, oddly, worked was changing the routing such that it used .mvc extensions as one might do for IIS6. I would like to avoid doing that. I have added logging in application_error but nothing is ever thrown in there. I actually have an ASP.net MVC 1 application on the same machine which works fine. I also just tried putting in a default document like in my asp.net mvc 1 app

        string originalPath = Request.Path;
        HttpContext.Current.RewritePath(Request.ApplicationPath, false);
        IHttpHandler httpHandler = new MvcHttpHandler();
        httpHandler.ProcessRequest(HttpContext.Current);
        HttpContext.Current.RewritePath(originalPath, false);

This worked fine for the / document but any links off of that still return a blank page.

Has anybody got an idea what it is I should be doing?

like image 757
stimms Avatar asked Mar 09 '10 22:03

stimms


1 Answers

"HTTP Errors" and "HTTP Redirection" services must be added to the "Web Server (IIS)" role in the "Server Manager" control panel. If you want to get static content like CSS and Javascript working, too, enable "Static Content" service as well.

like image 193
Lars Corneliussen Avatar answered Sep 23 '22 21:09

Lars Corneliussen