4
votes

I'm currently reading Pro ASP.NET MVC Framework by Sanderson. In the book he recommends setting up IoC using Castle Windsor, and he points out that the download automatically installs it and registers the Castle DLLs in the GAC. Well, at this point in time (5/4/2010), the Castle Project no longer has a downloadable installer that sets this up. Its all broken out into their individual subprojects with the raw files contained in zipped folders. Sadly there's no installation documentation that I can find about how to set it up. Being the noob that I am, I'm stuck and now forced to ask #1 where should castle windsor live on my hard drive? #2 how do I manually register the dlls properly? And, #3 should I be angry at the project maintainers for their oversight?

Here's the link: http://www.castleproject.org/castle/download.html

2

2 Answers

6
votes

Sanderson's book is already somewhat outdated about the Castle - ASP.NET MVC integration.

There is no oversight here really, the Castle developers team decided that the project was getting too big to be efficiently managed, so they split it. So now each of these new projects ships as a separate bundle, which includes the necessary DLLs.

There is no installer because it's really not necessary. As with most open source .Net libraries (like NHibernate, log4net, Rhino.Mocks, Moq, and lots others) you get the DLL, put it in some directory in your project (most people call it lib or Dependencies), then from your project you add a reference to the DLLs in this directory. No need to mess with the GAC at all.

You also need to get MvcContrib (the one that says MVCContrib.Extras.release.zip), which implements the Windsor - ASP.NET MVC integration (controller factory and extensions to register controllers, among other things). In fact, MvcContrib already includes Windsor so that's all you really need.

1
votes

You are looking for the Castle MicroKernel/Windsor project: http://www.castleproject.org/container/index.html

Here is a link to the "Getting Started" page: http://www.castleproject.org/container/gettingstarted/part1/index.html

Once you have downloaded the ZIP file, extract it to a known location on your hardrive (inside the Visual Studio solution directory is normal).

Follow the "Getting Started" guide, it steps you through which DLL's to reference in your project, and how to use it

Good luck!