# Thursday, January 17, 2008
« IE Browser Compatibility Testing | Main | Another Reason Why Google Maps Rules »

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.

HandlerMappings

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.

EditScriptMap

Once that is done, click "Request Restrictions" and then uncheck "Invoke Handler only if request is mapped to".

RequestRestrictions

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>
Thursday, January 17, 2008 3:57:24 AM (GMT Standard Time, UTC+00:00)
Don't forget to open your Windows firewall port(s) if you end doing testing from a Virtual PC.
Sneal
Comments are closed.