I'm deploying a castle monorail web application to Windows Server 2003. I've already set the httphandler mapping in web.config as follows :

<httpHandlers>
     <add verb="*" path="*.castle" type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework" />
</httpHandlers>

<system.webServer>
    <handlers>
      <add name="castle page" path="*.castle" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
    </handlers>
</system.webServer>

But whenever I tried to access http://localhost/app/Home/Index.castle the web server always returns HTTP 404 Not Found. It looks like the mapping is not handled by ASP.NET engine, like I've been missing a step or two in the configuration. Any solution?

有帮助吗?

解决方案

Because you are using IIS 6.0 the <system.webServer> section is ignored and you need to associate the .castle extension with the ASP.NET ISAPI filter in the IIS control panel.

Phil Haack blogged about how to achieve this with ASP.NET MVC and the .mvc extension. For you this would be the .castle extension:

enter image description here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top