Archive for category nuget

Adding packages to

clip_image001mmmmm, nuget.

These steps were written from the mindset of adding a package to the nuget gallery on that you require and happens to be missing. Anyone can add a package to for any project, even if you’re not a project contributor (although that is ideal). At Russell, we use a LOT of open source frameworks. While upgrading a portion of our code today, we decided to use nuget.  The first road bump we found was that did not have a package for Castle.Services.Transaction.  So what’s a open source loving dev gonna do then? Why, submit a package for it of course!

Steps to add a new package to (I’m making a lot of assumptions here, such as you know how to work the command prompt):

1) Make sure you have the nuget.exe command line tool.  If not, download the latest from here (or the complex site here) and stick it somewhere accessible from your path (I use d:\dev\tools). If you already have nuget.exe, you can run ‘nuget update’ to get the latest version. More details here from David Ebbo

2) Download the released version of the package you want to add, in this example I’m using Castle.Services.Transaction, which I downloaded from

3) Create an empty folder for the package, such as Castle.Services.Transaction, then create a subfolder called ‘lib’

4) Drop the binaries inside the lib folder. Since Castle.Services.Transaction has a NET35 and NET40 version, you’ll have multiple folders:

5) Delete ALL dependencies in the lib folder.  Castle.Services.Transaction depends on Castle.Core, but you do not want to include these in this package since Nuget handles dependencies for you.  The only binaries you want to include will be the binaries specifically for the project.

6) Create the manifest file by running the nuget spec command, with the –a [assembly location]. You’ll want to make sure you’re NOT inside the folder you created for this project. The .nuspec file will be created in your current folder.

7) Open the nuspec manifest and add the missing information. The Castle.Services.Transaction manifest is at the end of this email.

8) Now we get to generate the actual package. Run the nuget pack command, the first parameter is the .nuspec manifest, the –b parameter is the folder you created for the project, and the –o parameter is the output folder for the package. The –v parameter is for verbose output:

9) Login to, and click on “Contribute”, then “Add New Package”

10) Upload the .nupkg file that we just generated with nuget pack.

11) Verify the details of the package then click Next:

12) Choose a logo, or just click Finish to use the icon taken from the manifest:

13) Then, hopefully, a successful upload:

14) After a few minutes, you package should show up:

That’s all there is to it.  More information on creating packages can be found here: and Phil Haack’s post, which is a little more verbose than these simple instructions.

The Castle.Services.Transaction manifest:

<?xml version="1.0"?>
<package xmlns:xsd="" xmlns:xsi="">
 <metadata xmlns="">
 <authors>Castle Project Contributors</authors>
 <owners>Castle Project Contributors</owners>
 <description>Castle.Service.Transaction was inspired by the Java Transaction API (JTA), although it is a simplified version with no support for two phase commit.

Basically there is a transaction manager that is able to create transactions, that are associated with the thread. You can only have one active transaction per thread.

The transaction object only orchestrates the resources enlisted with it. It is up to the resource implementation to provide integration with some external transaction-capable entity, typically a database connection.</description>
 <dependency id="Castle.Core" version="2.5.1" />