harriyott.com

Setting up N2, the open source, ASP.NET (with optional MVC) CMS

Here's what I did to get started with N2, the best CMS I've used to date. I've not set up one of these for a while, so I thought I'd document the process:

  1. Check out the latest source from the subversion trunk - http://code.google.com/p/n2cms/source/checkout
  2. Ran Prepare_Dependencies-vs2008.bat in the root folder
  3. Ran Build_Everything-vs2008.bat, also in the root
  4. Made a copy of examples/Mvc to use as a new project
  5. Loaded the solution in VS2008
  6. Created the database, and ran the script
  7. Built and ran the project
  8. Navigated to /edit/install to see how I was doing



Not very well. I got a "No component for supporting the service N2.Web.Mvc.IControllerMapper was found" error. Google told me very little, except that someone else had the same problem and posted it on the forum. I posted too, and within half an hour, Steve Mason (who I worked with at Cubeworks, and is a contributor to N2) had replied asking for a stack trace. I provided one, and Steve provided the fix. Back on track.

I then checked /edit/install again, which prompted me to upgrade to version 2 of the database, by simply clicking a button. It then told me to add a root page, which I did. Now I'm up and running.

After copying a page or two, I kept getting a StackOverflowException thrown. Thanks to Joel and Jeff, these are harder to google for, but eventually I worked out that I needed to override TemplateUrl in the Model class (derived from AbstractPage).

6 January 2010