简体   繁体   English

IIS 7.5默认文档和ASP.Net MVC 2路由

[英]IIS 7.5 default documents and ASP.Net MVC 2 Routes

I am trying to deploy a website on Win Server 2008 R2 machine with IIS 7.5. 我正在尝试在具有IIS 7.5的Win Server 2008 R2计算机上部署网站。 The website is developed with asp net mvc2. 该网站是用asp net mvc2开发的。 My client asked me to deploy a simple .html document to be served until we decide to go live with the mvc app. 我的客户要求我部署一个简单的.html文档,直到我们决定启用mvc应用程序为止。 I have created the website and published my site for testing and it works perfectly, but I cannot make my application ignore the index.html page. 我已经创建了该网站并发布了我的网站进行测试,并且可以正常运行,但是我不能使我的应用程序忽略index.html页面。 Until now I have tried the following: 到目前为止,我已经尝试了以下方法:

  1. added IgnoreRoute("index.html") to the Global.asax.cs of my application 在我的应用程序的Global.asax.cs中添加了IgnoreRoute(“ index.html”)
  2. set the default document in IIS to be "index.html" 将IIS中的默认文档设置为“ index.html”
  3. removed all other files from default documents. 从默认文档中删除了所有其他文件。

but I still cannot get it right. 但我仍然做不到。

This is actually a feature of MVC. 这实际上是MVC的功能。 If there is an actual document that can be found at the location, that document will be used instead of the MVC ActionResult. 如果在该位置可以找到实际的文档,则将使用该文档代替MVC ActionResult。 I'll see if I can dig up the documentation. 我将查看是否可以查阅文档。

If your application is ready, why not just remove/rename the index.html? 如果您的应用程序已准备就绪,为什么不删除/重命名index.html?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM