Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget: The current environment doesn't have a solution open

I'm trying to install DeveloperForce.Web.Login I recently updated my nuget to the version 2.8.50313.31

PM> Install-Package DeveloperForce.Web.Login
Install-Package : The current environment doesn't have a solution open.
At line:1 char:16
+ Install-Package <<<<  DeveloperForce.Web.Login
    + CategoryInfo          : InvalidOperation: (:) [Install-Package], InvalidOperationException
    + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.InstallPackageCommand
like image 662
Benjamin RD Avatar asked Sep 07 '14 20:09

Benjamin RD


People also ask

How do I open a NuGet solution?

From Visual Studio, select Tools > NuGet Package Manager > Package Manager Console. After the Package Manager Console pane opens, verify that the Default project drop-down list shows the project in which you want to install the package. If you have a single project in the solution, it's preselected.

How do I get NuGet packages in Visual Studio 2022?

Set up Visual StudioIn Visual Studio, select Tools, and then select Options. Select NuGet Package Manager, and then select Package Sources. Enter the feed's Name and Source URL, and then select the green (+) sign to add a new package source. If you enabled upstream sources in your feed, clear the nuget.org checkbox.

How do I enable manage NuGet packages in Visual Studio?

To find and install a NuGet package with Visual Studio, follow these steps: Load a project in Solution Explorer, and then select Project > Manage NuGet Packages. The NuGet Package Manager window opens. Select the Browse tab to display packages by popularity from the currently selected source (see Package sources).

How do I install a NuGet package in PowerShell?

NuGet supports Install−Package, Update−Package, Find-Package, and Get−Package command and if Nuget package is not installed in your system, you may not find a package or install any package. For more reference about Nuget, check the websites below. To install NuGet, we need to use the Install−PackageProvider command.


1 Answers

In the package manager console, make sure to select the default project.

If there are no choices, it means that there is no solution file created for your project. When I tested this, I was able to fix the problem by pressing Ctrl + Shift + S (Save all). Visual studio then prompted me to select a directory for my .sln file and NuGet then successfully recognized my solution/project.

like image 183
Simon Farshid Avatar answered Sep 21 '22 12:09

Simon Farshid