How to Create Your First Nuget Package

2014/10/32 min read
bookmark this
Responsive image

PM> Install-Package CSharpMongo.dll

Start create my own nuget dll, since I have worked with MongoDB a little bit. So I'm trying to create useful library that I don't need to write code same code at my different solution. Unlike the original or old deployment, development, you'll chec-in your application's dependency dll. Nuget development is different! You don't need to check-in the dependency dlls, you will manage as package file which contains list of dependency dll of your current projects. 

So, when you build the solution of your visual studio, if you setup nuget correctly, visual studio will go to network to download the necessary dll to your local, by default should be inside the package folder. In additional, at the end of the build, these dll will copy to your bin folder.

Following instructure is about how to manully deploy to nuget.

1. Register to get Nuget account

Anyway, this blog I try to write how to simple create your own nuget package. First you need to go to nuget.org to register. 

2. Make sure your application is build and able to deploy to nuget

You have to make sure your application is build successfully, so when people get the dll by nuget won't break stuff. You should, think it as deploy to Production.

3. Create and publish a package.

See here for publish nuget package.