13

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
Steve
  • 213,761
  • 22
  • 232
  • 286
Benjamin RD
  • 11,516
  • 14
  • 87
  • 157
  • Well, do you have the solution open? – Ufuk Hacıoğulları Sep 07 '14 at 20:40
  • I have the solution open, but for some reason, VS does not recognize the application @UfukHacıoğulları – Benjamin RD Sep 07 '14 at 20:41
  • Try installing the package from the "Manage NuGet Packages for Solution..." dialog. – Simon Farshid Sep 07 '14 at 20:44
  • 3
    Possible duplicate of [How to resolve "Install-Package : The current environment doesn't have a solution open."](http://stackoverflow.com/questions/20878674/how-to-resolve-install-package-the-current-environment-doesnt-have-a-solutio) – mlt Dec 24 '15 at 21:38

3 Answers3

33

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.

Simon Farshid
  • 2,636
  • 1
  • 22
  • 31
0

It is simpler than you can think of!

J**

just do -> click on Save All under the File menu

** of MVS and then operate on the console manager

dhaval
  • 11
-4

Just like Farshid said, it means that there is no solution file created for your project and in order to fix this, press Ctrl + Shift + S. Visual studio will prompt you to select a directory for your .sln file which will in turn make NuGet recognize your solution.