White page with MVC4+ on IIS 7.0

隐身守侯 提交于 2020-01-15 11:29:06

问题


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

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.

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


回答1:


The cause

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.

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

<modules runAllManagedModulesForAllRequests="true" />

in the <system.webServer /> section




回答2:


When i using One Click publish After setup again server . I need click publish again and everything is working as desired



来源:https://stackoverflow.com/questions/20095946/white-page-with-mvc4-on-iis-7-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!