IIS 7.0上带有MVC4 +的白页 [英] White page with MVC4+ on IIS 7.0

查看:132
本文介绍了IIS 7.0上带有MVC4 +的白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题
创建新的ASP.NET MVC网站时,在生产或舞台上部署时,服务器会返回空白页。

The problem: When creating a new ASP.NET MVC site, when deployed on production or stage, the server returns empty white pages.

为了开发我们使用Visual Studio 2012,并且使用MVC 4模板创建站点,我们有IIS 7.5或8.0,具体取决于Windows的版本。

To develop we use Visual Studio 2012 and the sites are created using the MVC 4 template and we have IIS 7.5 or 8.0 depending on the version of Windows.

生产和阶段服务器正在运行带有IIS 7.0的Windows Server 2008。

Production and stage servers are running Windows Server 2008 with IIS 7.0.

推荐答案

原因

我们发现,自IIS 7.5以来,web.config的某些部分被移动到默认配置中。此外,网站模板要么采用IIS版本,要么基于IIS 7.5创建web.config。这意味着当您在运行IIS 7.0的服务器上部署站点时,会出现问题。

What we found out is that since IIS 7.5 some parts of the web.config are moved into the default configuration. Also, the web site template either assumes the IIS version or creates a web.config based on IIS 7.5. That means that when you deploy the site on a server running IIS 7.0, the problem will occur.

解决方案
只需转到在web.config中添加此行

The solution Simply go in the web.config and add this line

<modules runAllManagedModulesForAllRequests="true" />

< system.webServer /> 部分

这篇关于IIS 7.0上带有MVC4 +的白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆