Tuesday, 30 September 2008

A Ready-To-Hack Visual Studio 2008 Solution including NHibernate and Castle Active Record

metafinkI've been taking my first steps into the wonderful world of NHibernate and Castle ActiveRecord, and to make things easier, I've put together a Visual Studio 2008 solution that should build NHibernate, Castle Core, Castle Windsor, Castle Microkernel and Castle ActiveRecord from source, just by firing it up in VS2008 and hitting Ctrl-Shift-B, so you can load it, build it, run it, and start hacking around and getting your hands dirty.

I didn't actually create any  of this - NHibernate is from www.nhibernate.org, Castle is from www.castleproject.org. Thing is, these projects are all interdependent to some extent, the official binaries aren't always up-to-date or in sync with each other, and building them from source means setting up nant, working through various machine-specific configuration glitches... so hopefully this will save you a bit of head-scratching. I've just done an svn trunk checkout from the various projects over the last few days, built each project using nant as per the included instructions, then extracted the Visual Studio projects for the actual runtime libraries (so I've left out unit tests, etc.) and combined it into a single solution, along with a very rudimentary ActiveRecord model project, a simple console app showing how to get things up and running using app.config, and a SQL Express .mdf file containing some test data to make sure it's working.

This is undocumented and full of holes - but if, like me, you've decided it's time to learn this stuff and you just want a working build to play around with, it'll probably save you a couple of hours.

Oh, and it's called Metafink. No reason - things just need a name.

Download it from http://www.dylanbeattie.net/misc/metafink.zip

EDIT: Turns out this isn't quite complete - trying to build it on a machine that had never had any of this stuff on it before, and it appears that  log4net and a couple of other DLLs that are required by NHibernate are missing from the package. For the sake of completeness (and being able to step-debug through the whole stack), I'll try and incorporate these as projects rather than just linking to the binaries - should get this sorted out later today / tonight. Sorry!

1 comment:

Mike Hadlow said...

Nice work! It's the main downside to working with open source tools if you want to run against the trunk. I have to keep Castle, NHibernate, NHibernate contrib and MvcContrib in sync at the moment and it's a right royal PITA.

Ayende feels our pain here:

http://ayende.com/Blog/archive/2007/08/06/Running-on-the-trunk-Building-Rhino-Commons.aspx

It's nice in that it's a simple command line script. I've adopted something similar, but with more manual intervention :P