Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve "Install-Package : The current environment doesn't have a solution open."

Tags:

I have a solution having 1 project. Open Package Manager Console, run Install-Package MSBuildTasks But it gave me an error below:

Install-Package : The current environment doesn't have a solution open. At line:1 char:16 + Install-Package <<<<  MSBuildTasks      + CategoryInfo          : InvalidOperation: (:) [Install-Package], InvalidOperationExcep     tion     + FullyQualifiedErrorId : NuGetNoActiveSolution,NuGet.PowerShell.Commands.InstallPackage     Command 

I don't understand why it comes. Kindly suggest me waiting for reply. Thanks

like image 887
user88 Avatar asked Jan 02 '14 07:01

user88


People also ask

How do I open control of package manager?

Opening the console and console controls Open the console in Visual Studio using the Tools > NuGet Package Manager > Package Manager Console command. The console is a Visual Studio window that can be arranged and positioned however you like (see Customize window layouts in Visual Studio).


1 Answers

I usually get this error because I created or opened a project (.csproj or other) that doesn't have a saved solution (.sln) associated with it.

If you go to File->Save All it should offer to save the solution somewhere. Save it and that makes the error go away for me.

like image 113
Laughing_Jack Avatar answered Sep 21 '22 13:09

Laughing_Jack