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

那年仲夏 提交于 2019-12-03 10:49:53

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/20878674/how-to-resolve-install-package-the-current-environment-doesnt-have-a-solutio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!