Return to site

Install Nuget Package Dotnet Cli

broken image


The .NET Core 2.0 CLI (dotnet.exe), works on all platforms (Windows, Mac, and Linux) and provides core NuGet features such as installing, restoring, and publishing packages.

  1. Install Nuget Package Dotnet Core
  2. Dotnet Install Nuget Package
  3. Dotnet Cli Install Package

Install a package dotnet add package adds a package reference to the project file, then runs dotnet restore to install the package. Open a command line and switch to the directory that contains your project file. Use the following command to install a Nuget package. The dotnet add package command provides a convenient option to add a package reference to a project file. After running the command, there's a compatibility check to ensure the package is compatible with the frameworks in the project. If the check passes, a element is added to the project file and dotnet restore is run. The.NET Core 2.0 CLI, dotnet.exe, works on all platforms (Windows, Mac, and Linux) and provides core NuGet features such as installing, restoring, and publishing packages. Dotnet provides direct integration with.NET Core project files (such as.csproj), which is helpful in most scenarios. Dotnet is also built directly for each platform and does not require you to install Mono.

  • The dotnet provides direct integration with .NET Core project files (such as .csproj), which is helpful in most scenarios.
  • It is also built directly for each platform and does not require you to install Mono.

Installation

  • On developer computers, install the .NET Core SDK.
  • For build servers, follow the instructions on Using .NET Core SDK and tools in Continuous Integration.

Commands

  • Create a NuGet package using the dotnet CLI. No matter what your package does or what code it contains, you use one of the CLI tools, either nuget.exe or dotnet.exe, to package that functionality into a component that can be shared with and used by any number of other developers.This article describes how to create a package using the dotnet CLI.
  • The dotnet CLI allows you to easily install, uninstall, and update NuGet packages in projects and solutions. It runs on Windows, Mac OS X, and Linux. Open a command prompt, and then navigate to the directory that contains the project file. Use the following dotnet CLI commands to perform the respective operations.
Client

The dotnet CLI provides the following essential nuget.exe commands.

Add

Adds a package reference to a project file.

Examples

Add Newtonsoft.Json NuGet package to a project.

Add a specific version of a package to a project.

Add a package using a specific NuGet source.

Remove

Removes package reference from a project file.

Examples

Removes Newtonsoft.Json NuGet package from a project in the current directory.

Restore

Restores the dependencies and tools of a project.

Examples

Install Nuget Package Dotnet Cli

The dotnet CLI provides the following essential nuget.exe commands.

Add

Adds a package reference to a project file.

Examples

Add Newtonsoft.Json NuGet package to a project.

Add a specific version of a package to a project.

Add a package using a specific NuGet source.

Remove

Removes package reference from a project file.

Examples

Removes Newtonsoft.Json NuGet package from a project in the current directory.

Restore

Restores the dependencies and tools of a project.

Examples

Restore dependencies and tools for the project in the current directory.

Restore dependencies and tools for the app1 project found in the given path.

Restore the dependencies and tools for the project in the current directory using the file path provided as the source.

Restore the dependencies and tools for the project in the current directory using the two file paths provided as sources.

Restore dependencies and tools for the project in the current directory and shows only minimal output.

Locals

Clears or lists local NuGet resources.

Examples

Displays the paths of all the local cache directories (http-cache directory, global-packages cache directory, and temporary cache directory).

Displays the path for the local http-cache directory.

Clears all files from all local cache directories (http-cache directory, global-packages cache directory, and temporary cache directory):

Clears all files in the local global-packages cache directory.

Clears all files in the local temporary cache directory.

Pack

Packs the code into a NuGet package.

Examples

Pack the project in the current directory.

Pack the app1 project.

Pack the project in the current directory and place the resulting packages into the nupkgs folder.

Push

Pushes a package to the server and publishes it.

Examples

Pushes foo.nupkg to the default push source, specifying an API key:

Push foo.nupkg to the custom push source https://customsource, specifying an API key:

Pushes foo.nupkg to the default push source:

Pushes foo.symbols.nupkg to the default symbols source:

Install Nuget Package Dotnet Core

Pushes foo.nupkg to the default push source, specifying a 360-second timeout:

Pushes all .nupkg files in the current directory to the default push source:

Delete

Dotnet Install Nuget Package

Deletes or unlists a package from the server.

Examples

Deletes version 1.0 of package Microsoft.AspNetCore.Mvc:

Dotnet Cli Install Package

Deletes version 1.0 of package Microsoft.AspNetCore.Mvc, not prompting user for credentials or other input:





broken image