

To update all packages in a project (or reinstall using -reinstall), use -ProjectName without specifying any particular package: Update-Package -ProjectName MyProject Update-Package -ProjectName MyProject -reinstall To limit the action to a specific project, use the -ProjectName switch, using the name of the project as it appears in Solution Explorer: # Reinstall the package in just MyProject Update-Package īy default, Update-Package affects all projects in a solution.
VISUAL STUDIO FOR MAC UPDATE NUGET INSTALL
The command gives an error if the package in question is not already installed in a project that is, Update-Package does not install packages directly. The same command without -reinstall updates a package to a newer version, if applicable. Using this command is much easier than removing a package and then trying to locate the same package in the NuGet gallery with the same version. Using Update-Packageīeing mindful of the Considerations described below, you can easily reinstall any package using the Update-Package command in the Visual Studio Package Manager Console ( Tools > NuGet Package Manager > Package Manager Console). In all cases, use the notation described in Package versioning. For example, to constrain updates to version 1.x, set allowedVersions to [1,2): To set a constraint, open nfig in a text editor, locate the dependency in question, and add the allowedVersions attribute with a version range. This prevents accidental updates that would break the application. For example, if you know that your application works only with version 1.x of a package but not 2.0 and above, perhaps due to a major change in the package API, then you'd want to constrain upgrades to 1.x versions. In projects using the nfig management format, however, you can specifically constrain the version range. The Install-Package command does not provide an option to force a reinstall, so use Update-Package -reinstall instead.īy default, reinstalling or updating a package always installs the latest version available from the package source. Reinstalling a package during its development: Package authors often need to reinstall the same version of package they're developing to test the behavior.
VISUAL STUDIO FOR MAC UPDATE NUGET UPGRADE
For project upgrade, NuGet shows an error in the Project Upgrade Log. NuGet shows a build error in such cases immediately after project retargeting, and subsequent build warnings let you know that the package may need to be reinstalled.

For a single package, delete the package folder and use nuget install to reinstall the same one.įor the dotnet CLI, the equivalent procedure is not required. Switch to the Browse tab, search for the package name, select it, then select Install).įor all packages, delete the package folder, then run nuget install. On the Installed tab, select a package, record its name, then select Uninstall. On the Updates tab, select one or more packages and select Update Package Manager console (described in Using Update-Package) Updating and reinstalling packages is accomplished as follows: Method In Visual Studio, the Package Manager Console provides many flexible options for updating and reinstalling packages. Updating a package simply means installing an updated version, which often restores a package to working order. In these cases, uninstalling and then reinstalling the same version of the package will restore those references to working order. There are a number of situations, described below under When to Reinstall a Package, where references to a package might get broken within a Visual Studio project.
