Friday, December 24, 2010

Going down the .NET Dependency Rabbit Hole

After playing with Ruby on Rails earlier this month and becoming truly enamored with it's ease of use, succinct style and dynamic nature I was dreading going back to .NET development.  I thought my saving grace might be working with ASP.NET MVC which I have a growing respect for, although somewhat tempered after playing around with RoR.  That being said, I've spent the better part of two-full days trying to reconcile dependency issues with several OSS projects I'm using and unfortunately NuGet didn't solve my problem, but got in the way in some respects.




The main issue revolves around the widely popular Castle Windsor libraries (popular among OSS projects anyway) which are infamous for causing dependency issues when one or more of its core DLL's get out-of-sync with the projects using them.  In my case, I'm using NHibernate, MvcContrib and FluentNHibernate.  Initially, I was quite impressed that I was able to install all of these libraries via NuGet.  Unfortunately, I couldn't find all libraries needed for my project (in particular MvcContrib.Castle) which forced me to fetch it directly from codeplex.  Sure enough, this caused issues because the current "released" version of MvcContrib.Castle is dependent on an older version of Castle Windsor.  Pulling the source down and recompiling the project fixed the issue, but it does place a glaring spotlight on the need of a good package manager for .NET and that NuGet is long overdue.  That being said there's huge gap between what is out there now for .NET for package management (NuGet, hornget) and what Ruby developers are used to with gems and bundler.  I'm hoping that NuGet follows the gem/bundler story closely and implement some of the great features those projects possess.   I mean wouldn't be awesome if we could just define a NuGet file in our project or solution that specifies all the dependencies that we have and then NuGet just goes and fetches them for us on demand (and all their dependencies!).  No need to hunt for them at codeplex or google code, it just knows.  And if there's an update it notifies us and warns us of any possible version collisions with other libraries we're dependent on.  Sounds cool to me...

No comments:

Post a Comment