[整理]iis7.5下部署MVC5

IIS7.5下部署MVC5

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

1.安装iis 7.5

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

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
aspnet_regiis -irweb

C:\Windows\Microsoft.NET\Framework64\v4.0.30319
aspnet_regiis -irwindows

iisreset /restartapi

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

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

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

相关文章
相关标签/搜索