I’m planning on this being a start of a series of posts on Monorail, the MVC web framework from the Castle Project (www.castleproject.org). So, how to get started with Castle Monorail.

The first starting point is to download the last full release which is 1.0 Release Candidate 3. This is the first potential stumbling block for many in that it is a release candidate rather than a full release and has remained in this state since September 2007. However, the whole castle stack is, from my experience, very stable with a whole array of tests and is actively being developed.

Once downloaded, install and you should now have all the binaries etc located under C:\Program Files\CastleProject. This includes the Visual Studio integration to provide a Monorail and Active Record project types to get you started (although only available for VS2005 at this point in time).

Now, fire up VS2005 and create a new project. Select Visual C#->Castle Monorail Project. This will start up the Monorail project wizard.

Castle VS Wizard 1st Screen

For an initial getting started we’ll stick with the NVelocity view engine but we’ll enable Windsor integration as we’ll lean on this in a following post. We’ll also ignore the routing engine for two reasons. For one, we don’t really need it right now, and the other more important reason is that it causes an error with the end project. OK, next screen.

Castle VS Wizard 2nd Screen

For now, we’ll ignore these options but we’ll come back to the Active Record Integration in a later post.

Castle VS Wizard Last Screen

The last wizard screen asks us if we are a TDD enthusiast and if selected gives us a separate test project using NUnit as the test framework. Keep this option selected and hit Finish.

We now have our starting Monorail project. To see it in action select the properties of the project and set the web properties to use either IIS or the VS Development Server and hit F5.

Monorail Starting Application 

You should get the homepage as above. This is the starting Monorail application generated by the wizard and gives us everything we need for starting out with Monorail and the ending point for this blog post. Further posts will explore the different elements of Monorail, its testability and the Windsor integration.