C # NuGet commonly used commands

Command positions: Tools => Package Manager Nuget => Package Manager console

First, install

1. Install the specified version library
install-package <package name> -version  <version number>

2. Install the specified item
install-package <package name> -project XXXProjectName -version  <version>

Second, update

Update-Package <package name>

Third, re-install

1. Nuget reinstall all packages (will reinstall the entire solution)
Update-Package -reinstall

2. Specify items reinstall all packets Nuget
Update Package--project  <project name>  -reinstall

Fourth, uninstall

1. Normal Uninstall: uninstall-package <package name>

2. Force Uninstall: Uninstall-Package <package name> -Force

V. inquiry

Get-Package lists the default local package already installed you can add parameters -remote -filter entityframework to find the package you want in the package sources.

 

Sixth, Frequently Asked Questions

Nuget prompted to install dll "has dependencies defined as system.diagnostics.tracesource" because nuget version is relatively low due.

Solution:

Open VS-> Open menu "Tools" - "expanded and updated" -> select "Update" -> select "Visual Studio Library" => Click nuget be updated;

 

 

Reprinted https://www.cnblogs.com/xcsn/p/6259853.html

 

Guess you like

Origin www.cnblogs.com/cn-q/p/11129042.html