Publishing NuGet Package using NuGet Packager Extension

In one of my last post I have explained how we can create a NuGet Package on every build and deploy it to NuGet server in Azure.

In this post I would like to emphasize on how we can use the NuGet Package Extension in Visual Studio and publish NuGet packages to the server.

First of all we need to install the extension from the following url Once you have installed the extension for Visual Studio you can get the project template to create NuGet Package as shown below.


Once you add the NuGet Packager project to your solution, you can find the project hierarchy as shown below.


Now all you need to do is configure the NuGet project in order to take the libraries that you would like to publish. Open the NuGet.config file and provide the server url where the package is going to get published. Add the ApiKey which will validate the publishing of the library.


Copy your libraries that you would like to publish in the lib folder of the NuGet project.


Rename package.nuspec file to a name that you would like to distinguish for and update the project url in the nuspec file pointing to the publishing server


Change the description and other parameters as you want. You can even provide the dependencies to get installed or validate during the installation of the package

Now all we need to do is build the Package project. You might encounter some issues during building the package if you have renamed the nuspec file. Open NuGetPackage.ps1 file and change the following statements to point to correct NuSpec name


Build it again. Now you will not see any error. When you are building the NuGet project in Debug mode it will create the package *.nupkg file locally. In order to deploy it to the server through build process, you need to build it in Release mode.

Now if you go to the NuGet feed url of your server you can view the package over there.


You can even view through NuGet package manager the package installed.


If you want to delete the package from the server then you need to use the following command in Command Prompt.

nuget delete <Package Name> <Version> <API Key> –Source <NuGet Server Url>


That’s it you are good to go.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.