【发布时间】:2016-01-05 22:46:25
【问题描述】:
我是mono 的新手,正在尝试使用路由运行一个简单的hello world 应用程序。虽然我的应用程序在 IIS 上运行良好,但当我浏览到站点的根目录时出现 404 错误。我的路线映射如下:
RouteTable.Routes.MapPageRoute("default", String.Empty, "~/site/home.aspx")
直接浏览文件 (http://myhostname/site/home.aspx) 有效。
我尝试使用以下web.config -- 有和没有system.webServer 部分:
<configuration>
<system.web>
<compilation strict="false" explicit="true" targetFramework="4.0" />
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
<handlers>
<add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
我将nginx 与fastcgi-mono-server4 一起使用,我的fastcgi_index 设置为Default.aspx(我尝试过小写以及Index.aspx)。
我在这里遗漏了什么或者单声道只支持使用 MVC 的路由?
【问题讨论】: