Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • C# Data Types
  • C# Decision Making
  • C# Methods
  • C# Delegates
  • C# Constructors
  • C# Arrays
  • C# ArrayList
  • C# String
  • C# Tuple
  • C# Indexers
  • C# Interface
  • C# Multithreading
  • C# Exception
Open In App
Next Article:
How to Install npgsql in c#?
Next article icon

How to Install Nuget Package in C#?

Last Updated : 15 Dec, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

In this tutorial, we will be seeing how to install NuGet packages in C#. NuGet is the official package-manager for .NET. Packages are basically compiled libraries with some descriptive metadata. NuGet is an important tool for any modern development platform through which developers can create, share, and consume useful code. NuGet packages can also be defined as "re-usable and pre-defined pieces of code which benefit other developers as well".

Prerequisites: Visual Studio, Stable Internet, C#

Downloading and Installation of Nuget package in C#

Follow the further steps to install Nuget Package in C#

Step 1: Creating or Opening an existing project

NuGet packets are installed in projects and hence we first need to create a project or open an existing one.

In this particular tutorial, we will be creating a MVC project. Here we are using Visual Studio 2019 and naming the project as NugetDemo.

Click on create a new project and choose ASP.NET Web Application(.NET Framework) and click next.

ASP.NET Web Application
 

Step 2: Then we name the project. Here it is named as NugetDemo and click Create.

Nuget Demo
 

Step 3: Next click MVC and click on the create button.

ASP.NET MVC applications
 

After following the above steps, the project has been created and we shall now see the NuGet Package Installation. We are going to be installing the Bootstrap package. For more details on Bootstrap click here.

There are multiple approaches to do so.

Approach 1: Using Packet manager console to install Bootstrap package

Step 4: Go to Tools->NuGet Package Manager->Packet Manager Console

Packet Manager Console
 

Step 5: Installing via commands

The general command syntax:  Install-Package <package_name>

For Bootstrap the command will be:  Install-Package bootstrap

Once installed you will get the following screen.

Install bootstrap package
 

Note: You can even specify the version name however by default it is the latest one like in case of bootstrap it is 5.2.2. 

For Bootstrap the command with the version specified will be: Install-Package bootstrap -Version 5.2.2

Once installed, you will get the following acknowledgment.

Install-Package bootstrap -Version 5.2.2
 

Approach 2: Using Manage packages for solution to install Bootstrap package

Step 4: Go to Tools->NuGet Package Manager->Manage NuGet Packages for Solution... 

The below screen will appear and now search for the required package in Browse, and choose the version(optional).

Manage NuGet Packages for Solution
 

Step 5: Click install on the bottom right corner.

After clicking install wait for a few seconds and you shall get a confirmation as follows:

Nuget installed
 

Note: In order to install or uninstall NuGet packages make sure your project is not running. If it is, stop running, install or uninstall and then build the project and run.


Next Article
How to Install npgsql in c#?
author
arorapranay
Improve
Article Tags :
  • Technical Scripter
  • C#
  • How To
  • Installation Guide
  • Technical Scripter 2022
  • how-to-install

Similar Reads

  • How to Install a New Package Manager in Linux
    Linux offers several package managers for software installation, updates, and maintenance. In Linux, every distribution comes with a package manager by default. The Debian distribution comes with APT(Advanced Package Tool), Red Hat, and its derivatives such as CentOS and Fedora use YUM package manag
    4 min read
  • How to Install npgsql in c#?
    Npgsql is a .NET data provider for PostgreSQL, a popular open-source database management system. It allows applications written in .NET languages (such as C# or VB.NET) to connect to and interact with a PostgreSQL database. Npgsql is an open-source .NET data provider for PostgreSQL, a popular open-s
    2 min read
  • How to Install Package Manager in Windows 11?
    Installing a package manager on Windows 11 is a convenient way to streamline your software management. One of the most popular tools for this purpose is Winget, the built-in Windows 11 package manager. With Winget, you can easily download, install, and update software via the command line, making it
    5 min read
  • How to Install GIT by NPM Packages?
    Git is a library for git written in Node.js which allows for the manipulation of git repositories by the Node.js application. Git (npm), not to be confused with GIT, the version control software is a Node.js port of the now-defunct Git project. It is fairly synchronous as-is, and it allows the devel
    2 min read
  • How to install NumPy in PyCharm?
    In this article, we will cover how to install the Python NumPy package in PyCharm. NumPy is a general-purpose array-processing Python package. It provides a high-performance multidimensional array object, and tools for working with these arrays. As one of the most important tool while working with d
    2 min read
  • How to Install Multiple R Packages?
    In this article, we will see how to install multiple packages in R Programming Language. Installation can be done in two ways. Method 1: Installation using application options Step 1: Open R Studio Step 2: Navigate to Tools and select the Install packages option  Step 3: In the Text box packages, en
    1 min read
  • How to Install and Remove Packages in Arch Linux
    Arch Linux, known for its simplicity, flexibility, and user-centric approach, offers a robust package management system that allows users to easily install, update, and remove software packages. Unlike some other Linux distributions that come pre-packaged with software management tools, Arch Linux f
    5 min read
  • How to Force an NPM Package to Install?
    Forcing an NPM package to install can be necessary in cases where the dependencies of a package are in conflict or when you need to override existing constraints or force the installation of a specific version. Forcing an NPM package to install refers to using specific commands to bypass version con
    3 min read
  • How to Install ntopng in Linux?
    ntopng is an Open Source Tool to monitor the network. It is a security network monitoring tool, also monitors web activities passively. It is also used for packet capturing, Traffic Recording, and Network Probing. A huge number of companies like Google, HP, Cisco, IBM, and many more uses ntop. It ac
    2 min read
  • How to Install PowerShell in Linux?
    PowerShell is well-known among Windows administrators. It is a.NET-based task-based command-line shell and scripting language. You can quickly automate tasks for operating system maintenance and much more with PowerShell. PowerShell was once only available for Microsoft Windows. This admin tool, on
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences