Between nuget.org and private package galleries that your organization might establish, you can find tens of thousands of highly useful packages to use in your apps and services. But regardless of the source, consuming a package follows the same general workflow.
-->
* Visual Studio and
dotnet.exe
only. The nuget install
command does not modify project files or the packages.config
file; entries must be managed manually.
You can add the directory that contains the.nupkg file as a package source in Visual Studio for Mac. Select Preferences from the main menu. Open NuGet - Sources in the Preferences dialog. Click the Add button. In the Add Package Source dialog that opens click the Browse button. Find the directory with your.nupkg file then click the Open button. Extension for Visual Studio Code - Add or remove.NET Core 1.1+ package references to/from your project's.csproj or.fsproj file using Code's Command Palette. When you add the package source in Visual Studio this is where the package source will be saved. For each solution Visual Studio will look in several directories for the NuGet.Config file before using the one from the user's profile. Update and Restore NuGet packages is available if a solution or project is selected. I would right click the project and select Add - Add NuGet packages, or right click the Packages folder and select Add Packages or double click the Packages folder instead to open the Add Packages dialog.
For further details, see Finding and Choosing Packages and What happens when a package is installed?.
NuGet remembers the identity and version number of each installed package, recording it in either the project file (using PackageReference) or
packages.config
, depending on project type and your version of NuGet. With NuGet 4.0+, PackageReference is preferred, although this is configurable in Visual Studio through the Package Manager UI. In any case, you can look in the appropriate file at any time to see the full list of dependencies for your project.
![Visual Studio For Mac Add Nuget Package Visual Studio For Mac Add Nuget Package](/uploads/1/3/3/2/133272430/481217079.png)
Tip
Visual Studio For Mac Add Nuget Packages
It's prudent to always check the license for each package you intend to use in your software. On nuget.org, you find a License Info link on the right side of each package's description page. If a package does not specify license terms, contact the package owner directly using the Contact owners link on the package page. Microsoft does not license any intellectual property to you from third party package providers and is not responsible for information provided by third parties.
When installing packages, NuGet typically checks if the package is already available from its cache. Iskysoft itube studio for mac crack. You can manually clear this cache from the command line, as described on Managing the global packages and cache folders.
NuGet also makes sure that the target frameworks supported by the package are compatible with your project. Free daz studio graphmate for mac plugin download. If the package does not contain compatible assemblies, NuGet displays an error. See Resolving incompatible package errors.
When adding project code to a source repository, you typically don't include NuGet packages. Those who later clone the repository or otherwise acquire the project, including build agents on systems like Visual Studio Team Services, must restore the necessary packages prior to running a build:
Package Restore uses the information in the project file or
packages.config
to reinstall all dependencies. Note that there are differences in the process involved, as described in Dependency Resolution. Also, the diagram above does not show a restore command for the Package Manager Console because if you're with the Console you're already in the context of Visual Studio, which typically restores packages automatically and provides the solution-level command as shown.
Occasionally it's necessary to reinstall packages that are already included in a project, which may also reinstall dependencies. This is easy to do using the
nuget reinstall
command or the NuGet Package Manager Console. For details, see Reinstalling and Updating Packages.
Finally, NuGet's behavior is driven by
Nuget.Config
files. Multiple files can be used to centralize certain settings at different levels, as explained in Configuring NuGet Behavior.
Ways to install a NuGet Package
NuGet packages are downloaded and installed using any of the methods in the following table.
Visual Studio Code Add Nuget
Tool | Description |
---|---|
dotnet.exe CLI | (All platforms) CLI tool for .NET Core and .NET Standard libraries, and for SDK-style projects that target .NET Framework (see SDK attribute). Retrieves the package identified by <package_name> and adds a reference to the project file. Also retrieves and installs dependencies. |
Visual Studio | (Windows and Mac) Provides a UI through which you can browse, select, and install packages and their dependencies into a project from a specified package source. Adds references to installed packages to the project file. |
Package Manager Console (Visual Studio) | (Windows only) Retrieves and installs the package identified by <package_name> from a selected source into a specified project in the solution, then adds a reference to the project file. Also retrieves and installs dependencies. |
nuget.exe CLI | (All platforms) CLI tool for .NET Framework libraries and non-SDK-style projects that target .NET Standard libraries. Retrieves the package identified by <package_name> and expands its contents into a folder in the current directory; can also retrieve all packages listed in a packages.config file. Also retrieves and installs dependencies, but makes no changes to project files or packages.config . |