Setting up Monorail to work on IIS7 isn't necessarily straight forward. First you need to configure IIS7 to handle the particular file extension you are using for Monorail. This is just like you would do in IIS6, but with some slightly different menus and terminology.
I'm using .rails for this particular application. For the website or virtual directory you are configuring in IIS7, open the Handler Mappings in IIS Manager.
From there create a new Script Map, by clicking "Add Script Map..." This opens the Script Map dialog. You should enter *.rails as the request path and the aspnet_isapi.dll path as the executable.
Once that is done, click "Request Restrictions" and then uncheck "Invoke Handler only if request is mapped to".
Once that is done you may run into a problem with your monorail section in the web.config. I had this error:
An error occurred creating the configuration section handler for monoRail: Object reference not set to an instance of an object.
Odd, my web.config works in IIS6 and in webdev.webserver.exe. As it turned out I had to fill out the assembly element in my MonoRail section even though I'm using Windsor integration. I've bolded the part I had to add below:
<monorail useWindsorIntegration="true">
<controllers>
<assembly>Sneal.Store.Commerce</assembly>
</controllers>
<viewEngines viewPathRoot="Views">
<add type="Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine, Castle.MonoRail.Framework.Views.NVelocity" />
</viewEngines>
</monorail>
Powered by: newtelligence dasBlog 2.1.8102.813
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010, Shawn Neal
E-mail