--------------------------------------写给我自己的文章。
之前没看过mvc1.0,mvc2.0的相关文档。导致我一次误操作,而使mvc部署好的站点一时间无法访问。当然这事发生在本地机器,如果在服务器上,老板肯定会让我吃不了兜着走的。
事因:帮朋友弄个asp网站urlrewrite,朋友网站所在空间商,不支持而说支持,而寻找证据。本地机器没装,下个ISAPI_Rewrite_Lite.msi安装之后,重写不了。而且导致其他问题。如是在iis->网站->属性->ISAPI筛选器 误删除了 ASP.NET_4.0.30319.0,并 保存,卸载了ISAPI_Rewrite_Lite。
导致问题:mvc所有站点,.net2.0,.net4.0站点 访问不了。重新设置,Mvc站点依然没办法恢复。
找了一些国内的网站,可能没查对关键字,google也不太给力。没找到 有价值的,在国外找到了一些零碎的东西,不全也没弄好。
最后找到一篇:
Deploying ASP.NET MVC to IIS 6
http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/
Option 1: Use a wildcard mapping for aspnet_isapi.dll
This tells IIS 6 to process all requests using ASP.NET, so routing is always invoked, and there’s no problem. It’s dead easy to set up: open IIS manager, right-click your app, go to Properties, then Home Directory tab, then click Configuration. Under Wildcard application maps, click Insert (not Add, which is confusingly just above), then enter C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll for “Executable”, and uncheck Verify that file exists.
iis->网站->属性->主目录->配置->映射->插入(注意不是添加扩展名,是通配符) 噢。。。注意这个设置。
一切都好了。
疑问:在iis->网站->属性->ISAPI筛选器-> 删除ASP.NET_4.0.30319.0筛选设置,为何会删除,各个mvc部署站的通配符设置?这个真让我疑惑。