Monthly Archives: January 2011

Paul Stovell’s Tape

Not long after the RTM release of ASP.NET MVC and NuGet, Paul Stovell has come up with an alternative approach to dependency management – “Tape”. Basically what Paul’s tool does is merge all the source files in a particular directory into a single file that can be easily referenced into a project. So why is this helpful, and better than adding assembly references?

Well the first thing to point out is that Paul is only half serious, but what he is doing attacks a particular problem that the .NET community is already facing with interdependencies between open source projects. Consider the following scenario:

  • Your project [A] depends on open source projects [B] and [C].
  • One of your dependencies [B] also depends on [C], but a different version.
  • You project depends on [C2], and the open source project depends on [C1].
  • There are incompatibilities between [C1] and [C2].

Here the developer has to either down-grade their code, or try to upgrade the open source project either by recompiling it with new dependencies, or worse, having to delve into the open source projects code and make adjustments.

With the introduction of various packaging formats into the community this is a problem that is likely going to get worse because the chances of people actually using a particular open source project is only going to increase (the barriers for entry just got lower). The upside is that it will create pressure for active open source projects to keep their dependencies moving forward.

Still, I actually think what Paul has done has some merit. I am constantly impressed with what the guys at GitHub are doing with “gist” which is a quick way of sharing snippets of code. Tape would be a great client for gists that you wanted to include in your project.

NHashcash 1.1.0 is in the public NuGet repository.

I’m slowly working through my backlog of open source pet-projects. One that I worked on quite a while ago was called NHashcash, a managed .NET implementation of the anti-spam mechanism, Hashcash. Hashcash hasn’t been broadly adopted as far as I can tell but I thought it would be interesting to make the library available via NuGet anyway.

You can install the NHashcash library by issuing the following command on the NuGet package manager console:

install-package NHashCash

The screenshot below highlights this command and the assembly that it adds to the currently selected project references. The sample code is just there to give you an overall taste for the API (its very simple to use).


If you are interested in the source code you can grab it from the project portal on CodePlex. The 1.1.0 version of NHashcash has a major bug fixed there the timestamp used for stamps was incorrectly being generated. I guess its a testament to how few people use Hashcash that the bug was never found, and also how poor my initial unit tests were.

On the unit testing front I’ve improved the tests somewhat to validate against the reference implementation of Hashcash (which was how I found the bug). I also used the MSTestContrib library that I blogged about a few days ago to make the tests more BDD-style.

Finally, there is more work to be done around performance on NHashcash since it was never an optimal implementation. Anyway – if you can’t use NuGet you can always download it directly from here.