[整理]iis7.5下部署MVC5

IIS7.5下部署MVC5

测试环境服务器部署
windows server 2008 r2

1.安装iis 7.5

2.安装 .net framework4.5.1并注册

cd C:WindowsMicrosoft.NETFrameworkv4.0.30319
aspnet_regiis -ir

C:WindowsMicrosoft.NETFramework64v4.0.30319
aspnet_regiis -ir

iisreset /restart

3.部署站点,选择程序池 集成或经典 都可

设置默认页面为站点下存在的default.html
至此,站点可以访问,但mvc路由和webapi 访问返回404。

4.iis7.5里【ISAPI和CGI限制】中开启asp.net v4.0.30319 32bit /64bit扩展

5手动在bin里添加

Microsoft.Web.Infrastructure.dll
System.Web.Optimization.dll

至此,webapi也可以正常访问了。
但是,直接访问http://xxx.xxx.xxx.xxx:8086/ 返回404,默认主页已经设置为default.html,但是无效,必须访问http://xxx.xxx.xxx.xxx:8086/default.html才有效

好吧,感觉应该是mvc route默认设置的问题,取消了//RouteConfig.RegisterRoutes(RouteTable.Routes); 就OK了。

原文地址:https://www.cnblogs.com/Benoly/p/4501257.html