Gems - Package Management For .NET

The Ruby community has enjoyed a great user experience with a package management system they use called Gems. A gem is a package (or a library), compressed with some additional metadata, and can be either source files or binaries. Let’s focus on binary gems. We have the same concept in .NET (DLLs/EXEs). You may have references to other DLLs. When you want to update a reference you are using on a project, you may also need to update its dependencies as well. And so on and so forth. A package management project is meant to help make that easier. It’s actually really hard to explain what gems or package management without just showing you. So take a look here:

  gem install sidepop - installed log4net - installed sidepop

I type:

gem install sidepop

And that’s it. It looks and sees that I have a dependency on log4net. Notice how it nicely just pulls down log4net version 1.2.10 as well?

Background

I can count on one hand all of the package management projects that have been started for .NET. Dru Sellers, Chris Patterson, and I have talked about package management stuff from time to time. Dru and Chris have been a part of one project (Nu) that has been started several times to start to answer this question. We’ve participated on the mailing list for HornGet. At one point I casually asked why we couldn’t just use gems. Other people out there have probably stated the same thing. But no one has really carried the idea forward. Until now.

Yesterday Dru asked for a gem-ify feature for UppercuT. We started talking and looking at how easy it is to create a gem. Then we figured out how to make the executables piece work as well. This is where you can install a gem and then call the executable from the command line anywhere and get output. From the thread on ChuckNorris where we talked about this:

Here is something you might find pretty interesting: http://rubygems.org/gems/roundhouse 

If you have ruby installed, you can install roundhouse now from the command line:

gem install roundhouse

This gives you the opportunity to type this anywhere:

rh <options>

Why Should I Care?

If you work with Open Source, you know how much of a pain it can be to update your references. You update one library, say NHibernate, and find out that you also need to update your references to Castle. And possibly, you might then need to update your references to log4net. It can be a painful process. This is the start of answering that question.

Right now it's starting to look like the answer for gems in .NET is just gems.Why Should I Get Excited?

It sounds like Jeremy Miller among others are getting excited about this. And why not? We’ve been trying to answer the gems question since Ruby made it so easy.

The implications of this are awesome! I still haven’t fully grokked what we’ve just opened up.  But it’s huge!

It doesn’t get us all of the way there to updating the references in our source code folder. That’s where projects, like Nu, are going to start showing up that leverage the idea of using the gems infrastructure to get the libraries from the ruby folders to your source code folder. You are going to see UppercuT come back soon with taking care of getting your gem built with the proper version.

This is the start of something very cool.

 

Related Posts

Before you comment about “cluttering” the ruby community, please be sure to read this (we’re with you on this):  http://devlicio.us/blogs/rob_reynolds/archive/2010/07/19/gems-for-net-community-response.aspx

How To - Gems and .NET  and How To – Gems & .NET - Dependencies (References)

Walkthrough – Create Gems Even Easier With a Conventional Build (UppercuT)!

The Future is Now!


Posted 07-15-2010 11:27 PM by Rob Reynolds

[Advertisement]

Comments

Rob Reynolds - The Fervent Coder wrote How To - Gems And .NET
on 07-16-2010 3:10 AM

In my last post I showed gems being used for .NET. Now let’s talk about How.  Most of this stuff

zihotki wrote re: Gems - Package Management For .NET
on 07-16-2010 7:52 AM

I second that, I like code reuse and that is a very interesting approach. But probably there should be a separate site for .NET libraries

Rob Reynolds wrote re: Gems - Package Management For .NET
on 07-16-2010 9:13 AM

@zihotki: I was thinking the same as well and we may very well end up there. But for now we are loving the idea of "One Community."

Rob Reynolds wrote re: Gems - Package Management For .NET
on 07-16-2010 11:26 AM

Rob Conery put it much better than I did about why gems is awesome: blog.wekeroad.com/.../why-i-like-ruby

Paul Cowan wrote re: Gems - Package Management For .NET
on 07-16-2010 10:29 PM

As the main developer on hornget, I do not see the delivery as the main problem in .NET, it is getting all the bits to play together.

The fact that by default most OSS sign their assemblies makes things difficult.

The amount of different Castle .dlls and boo .dlls in each open source project make delivery not the only problem.  If i use Nhibernate, Rhino and Castle in my project, delivering me 3 different versions of the castle .dlls is going to cause problems.

Relying on trunk builds is another common problem in .NET.  OSS like castle need to give us versioned releases that everybody else should be using.

Delivery is currently available but all the bits do not play together.  I know this from bitter experience.

Rob Reynolds wrote re: Gems - Package Management For .NET
on 07-17-2010 10:05 AM

@Paul: Thanks for the heads up. It's most appreciated.

At this point, we are registering everything for delivery. Then we are going to start tackling dependencies for compiled assemblies only.

The general idea we are looking at right now is looking at the versions of code at each release.

As we expand the idea, we'll probably need to look more into the kinds of things you are talking about.

Paul Cowan wrote re: Gems - Package Management For .NET
on 07-17-2010 11:45 AM

@rob Assembly signing is one of the curses in this space.  Lack of versioned  releases makes it really difficult also.

There are currently a number initiatives in this space like you guys, open wrap and brick to name a few.  It is seems wasteful to be be working in silos and not together on this one.

We need package management, it is really difficult, due to the dependency maze that currently exists.  I wish we could all somehow share our ideas on the subject.

Without package management, the bar to OSS is massive.

Rob Reynolds wrote re: Gems - Package Management For .NET
on 07-18-2010 9:12 AM

@Paul: This is not a problem we are trying to solve. Like Agile we are trying to bring the "pain" to the forefront so that it can be removed.

Dru does a much better job explaining it: codebetter.com/.../nu-and-the-oss-dependency-nightmare.aspx

Duncan Gunn wrote re: Gems - Package Management For .NET
on 07-19-2010 9:07 AM

Great stuff, will definitely keep an eye on this.  I use SVN: Externals to pull in any requirements, and then the link the project dependencies to this - so an SVN Update always gets me the latest built files; but I do realise this is for internal projects rather than open-source projects so doesn't really scale in all cases.

Rob Reynolds - The Fervent Coder wrote Gems For .NET – Community Response
on 07-19-2010 2:31 PM

There has been a lot of response in the community about this gems idea we’ve been talking about. I even

Rob Reynolds wrote re: Gems - Package Management For .NET
on 07-19-2010 3:34 PM

We made the newsletter for CodeProject.com!

www.codeproject.com/.../View.aspx

Pedro Santos wrote re: Gems - Package Management For .NET
on 07-22-2010 6:26 AM

Uh, ever heard of maven? It supports .Net as well. I assume you are just talking about dependency management in development, not after deployment. Otherwise, yes, of course, gems.

Rob Reynolds wrote re: Gems - Package Management For .NET
on 07-23-2010 8:08 AM

@Pedro: The package management here is for you to get released packages.  

It is based on putting your releases (binaries) up as gems and pointing to binaries you depend on (if there are any).

The cycle here is that other developers use those binaries to develop.  Then when they release, they point to the binaries they depend on as the put their binaries in a gem.

James Wampler wrote re: Gems - Package Management For .NET
on 07-26-2010 12:44 PM

Rob,

In your opinion, what is the advantages of Gems over something like Visual Studio Extension Manager in the .NET space?

I would think that for the majority of .NET developers, an integrated solution from within Visual Studio would better promote adoption of Open Source projects then a ruby based package manager running from the command-line.

I am still getting my feet wet with ruby, so I am  probably missing something really obvious?  Doesn't Extension Manager handle all the same things that Gems does?

Rob Reynolds wrote re: Gems - Package Management For .NET
on 07-26-2010 1:00 PM

@James: I don't know exactly what extension manager does, so if you want to explain in more detail, ping me through the contact or on twitter.

Here's what I know about Nu and Gems: www.youtube.com/watch

The absolute speed with which you can get gems up and grab the latest gem is the real power in gems.

It allows you to get your updates and move forward with your development instead of spending time finding all of the latest packages.

Rob Reynolds - The Fervent Coder wrote The Future of .NET Open Source Software Delivery
on 07-26-2010 4:18 PM

Imagine we are awhile into the future. How do you get open source releases down to your project so that

Community Blogs wrote Creating a "New" Gem for "Nu" - From 0 to 100 in 24 Hours
on 07-30-2010 4:08 PM

Has it really been 24 hours since I jumped on the nu project bandwagon? Sure has. Let’s take a step back

Rob Reynolds - The Fervent Coder wrote AppHarbor - Azure Done Right AKA Heroku for .NET
on 02-16-2011 7:55 AM

Easy and Instant deployments and instant scale for .NET? Awhile back a few of us were looking at Ruby

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)