Directory Image
This website uses cookies to improve user experience. By using our website you consent to all cookies in accordance with our Privacy Policy.

NuGet Packages and a Few Guidelines

Author: Nikunj Bhanushali
by Nikunj Bhanushali
Posted: Apr 16, 2015

Hello everyone! I am really excited to discuss a topic like NuGet Packages with you today. If you are viewing the word for the very first time, then you might be thinking it is kind of a tool. Nevertheless, this topic says the word "Packages" implies that there is more than one package.

  • NuGet is free and open source
  • It's a package manager for the Microsoft development platform
  • NuGet Gallery is the central package repository used by all package authors and consumers.
  • It is distributed as a visual studio extension.
  • NuGet will help us to integrate whole package in existing project.
  • NuGet also will help us to update existed package easily in our project.
What is package in NuGet?

Any package of NuGet gallery may contain any kind of files like dll, images and app settings and Powershell script that will be executed when we go to integrate package in our existing project.

The Goal of NuGet Packages

NuGet is a package management system for.NET. The goal of NuGet is to make the process of incorporating third party libraries into your solutions making it as simple as possible. If I say about goal in simple language, it is a way in which we can add or remove any package, which has already been made to fulfill a specified purpose/s. Thus, using NuGet we can integrate or disconnect the whole package into our project easily without any hassle. We may directly update the package if update is available in the NuGet gallery.

Let us have a look with example how we can use NuGet

Let us assume that we want to integrate 'Entity Framework' in our empty project.

  • Create a sample web based project in Visual Studio (2012).
  • Before going next please check your web config content &dll references those are already added by default in your empty project.
  • Go to Tools> Library Package Manager> Manage NuGet Package for Solution.
  • If you do not have option like this, then you may go to download and install it or may Google by typing - "NuGet package extension".
  • Now you will find option 'Online' at left side of opened a popup window.
  • Select 'Online' then you can type any package name at right side of that opened window.
  • For example, we may type 'Entity Framework'. Press enter to allow continue search.
  • You will find packages based on our search keyword and a button to install it in the project, select 'Entity Framework' to find relevant details. It will be written on the right side of the opened window. You can read package version, author, dependencies etc. Click on the install button to integrate it.
  • You will get the command to select project because your solution can have more than one project and get another command 'License Acceptance'.
  • Now 'Entity Framework' is installed in your empty project. Therefore, you can use it to interact with the database.

Now you can go and check references of your project and check the Web Config that will be modified.

These are some of the simple steps to be integrated to the package of your project. In the update section of that same window, you may find update option of your packages if it exists in NuGet gallery. You can remove it by entering the install section of that same window. There is also a way to add any package with specific version via package manager console.

Nikunj Bhanushali is associated with Cogzie as Sales & Operations head and who loves sharing information regarding ASP.NET, SharePoint, EPS Server and TFS Hosting. Get in touch with him for Asp.Net Development Projects

About the Author

Nikunj Bhanushali is associated with Cogzie as Sales & Operations head with vast experience in microsoft technologies like SharePoint, WWF, EPiServer, ASP.NET, MVC, N2CMS

Rate this Article
Leave a Comment
Author Thumbnail
I Agree:
Comment 
Pictures
Author: Nikunj Bhanushali

Nikunj Bhanushali

Member since: Apr 03, 2015
Published articles: 6

Related Articles