![]() ![]() To list all versions of a certain package: Find-Package -AllVersions -ExactMatch For example, to show the first 100 packages, use: Find-Package -First 100 To find and list packages whose name begins with a string: Find-Package -StartWithīy default, Find-Package returns a list of 20 packages. To find and list packages that contain certain keywords: Find-Package To find a package in the default source, use Find-Package. For example, running Get-Package -ListAvailable -PageSize 500 lists the top 500 available packages on the default source, such as, which could take several minutes. The button on the far right interrupts a long-running command. The control next to the project selector clears the console's contents. To manage package sources, select the gear icon, which opens the Tools > Options > NuGet Package Manager > Package Sources dialog box. To override these settings for single commands without changing the defaults, most console commands support -Source and -ProjectName options. Selecting a different package source or project changes the defaults for subsequent commands. For more information, see Customize window layouts in Visual Studio.īy default, console commands operate against the specific package source and project shown in the controls at the top of the window: The console is a Visual Studio window that you can arrange and position as you like. To open the Package Manager Console in Visual Studio, select Tools > NuGet Package Manager > Package Manager Console from the top menu. To correct the error, create and save a solution, or save an unsaved solution. Please ensure you have an open and saved solution. If you have an unsaved solution, or no solution, you see the error Solution is not opened or not saved. Many console operations depend on having a solution with a known path name open in Visual Studio. For example, to install the Elmah.MVC package, enter: Install-Package Elmah.MVCįor more details about these commands, see the Find a package and Install a package sections. Once you find the name, use the Install-Package command to install the package. If you already know the package name you want, skip this step. For example, to find packages that contain the keyword elmah, run the following command. In the console, enter Find-Package with a keyword to find the package you want to install. Open your project or solution in Visual Studio, and select Tools > NuGet Package Manager > Package Manager Console to open the Package Manager Console window. To use the Package Manager Console to quickly find and install a package: For more information, see Install and manage NuGet packages in Visual Studio for Mac. Visual Studio for Mac has a UI for managing NuGet packages, and the equivalent console commands are available through the NuGet CLI. ![]() Visual Studio Code and Visual Studio for Mac don't include the console. The Package Manager Console is built into the Package Manager for Visual Studio on Windows. If you're unable to use the extensions installer in Visual Studio, you can download the extension directly from. You can also search for the NuGet Package Manager extension under the Tools > Extensions and Updates or Extensions menus. You can also install the Package Manager by selecting Individual components > Code tools > NuGet package manager in the Visual Studio Installer. Starting in Visual Studio 2017, NuGet and the NuGet Package Manager install automatically when you create any. ![]() Each environment has commands that aren't available in the other, and commands with the same name might differ in their specific arguments. These commands differ from the PackageManagement module commands you can use in a general PowerShell environment. The PowerShell commands and arguments in this article are specific to the Visual Studio Package Manager Console. ![]()
0 Comments
Leave a Reply. |