ASP.net MVC on IIS 7 returning blank page

后端 未结 3 2065
难免孤独
难免孤独 2021-01-05 00:31

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

相关标签:
3条回答
  • 2021-01-05 00:43

    I also had not installed the HTTP Redirection role but I had a further issue that I thought I'd document here in case someone else has the same issue.

    I had zipped the program folder up using 7-Zip and transferred it to the prod server. When I unzipped it the web.config file in the Views folder had been added as a folder called web.config with the config file inside. Moving the file out and deleting the folder sorted this for me.

    The clue was in the Event Viewer so check there too if the other answers don't completely help.

    No more blank page for me now.

    0 讨论(0)
  • 2021-01-05 01:02

    "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.

    0 讨论(0)
  • 2021-01-05 01:02

    Just thought I'd add another reason why IIS / MVC might return a blank page... suppose you've got an app pool identity, which is authorised against the SQL database. Now suppose you've got two different identities, one for production, and one for pre-production. Now, further suppose that one of your esteemed colleagues decides to restore the database from production, over the one that exists in pre-production. Now you've got a copy of the prod database in pre-prod, which is authorised for the production user, but not for the pre-production user. In that situation, I was getting blank pages in pre-production now, because the authorisation for the pre-production user (which previously existed in the pre-production database) has now been wiped out by the restore of the database. Because that user ID is the app pool identity, now your MVC app no longer has rights to the database. This caused MVC to render blank pages, and caused me two days of chasing my tail because I thought someone had changed some IIS setting on the web server, but it was actually a database permissions issue. Maybe this will give a clue to someone with a similar problem in the future.

    0 讨论(0)
提交回复
热议问题