本文介绍了ASP.net MVC在IIS 7返回空白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些麻烦部署ASP.net MVC 2 RC 2应用到我的生产框。我有两个开发和测试工作良好。关键的区别似乎是生产彩盒尚未升级到IIS 7.5。在http://stackoverflow.com/questions/557730/i-am-getting-blank-page-while-deploying-mvc-application-on-iis.

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 http://stackoverflow.com/questions/557730/i-am-getting-blank-page-while-deploying-mvc-application-on-iis.

我试过无果那里列出的大多数事情。我曾经同时使用集成和经典配置为.NET 4试了又试去一个特定的控制器和行动,以防万一它是与默认的文件。我所做的尝试,奇怪的是,曾在变化的路由,使得它使用.mvc扩展为一个可能的IIS6做。我想避免这样做。我在的Application_Error添加记录,但没有什么是有过异常。其实,我的正常工作在同一台机器上的ASP.net MVC 1应用。我也只是试图在我的asp.net mvc的1个应用投入默认文档像

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?

推荐答案

HTTP错误和HTTP重定向服务必须添加到Web服务器(IIS)中的服务器管理器控制面板的作用。如果你想获得像CSS和Javascript的工作静态内容,也使静态内容的服务也是如此。

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

这篇关于ASP.net MVC在IIS 7返回空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 15:02