Mike Nichols - Son of Nun Technology

Early MonoRail Lessons #1- RailsFacility usage

I am using a new project I just started to learn MonoRail. I have completed a previous project using Ruby On Rails so was excited to dig into Monorail and have not been disappointed.

A very helpful sample application that has some great guidance is the Timok.Rbr sample. Inside this sample, they are utilizing the RailsFacility to wire up the controllers with underlying services automagically using Windsor (referencing the Castle.MonoRail.WindsorExtension package).

Since I can be like the Tasmanian Devil learning new technology, I kept overlooking a very simple configuration element that prevented me from enjoying the autowiring goodness. Inside the web.config for the monorail config section :

 

  <monorail smtpHost="yoursmtphost" useWindsorIntegration="true">   

Failure to set the useWindsorIntegration attribute to 'true' will result in :

No parameterless constructor defined for this object.

exception messages since the application doesn't know it should be using Windsor to inject your services. I knew what the problem was and knew this was a rookie mistake but wanted to post the exception message to point to the solution anyways. Of course, this would be wrongly set if you started out without intending to do the Windsor hookups.

Hope this helps.

Mike