Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Package Manager console not working

According to this http://docs.nuget.org/docs/start-here/using-the-package-manager-console I should see the PM prompt and commands like get-packages should work. With my VS2010 the Package Manager Console prompt says

PS E:\myprojectfolder 

and none of the commands work - it issues an error saying:

PS E:\project>  get-package -ListAvailable The term 'get-package' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is co rrect and try again. At line:1 char:12 + get-package <<<<  -ListAvailable     + CategoryInfo          : ObjectNotFound: (get-package:String) [], CommandNotFoundException     + FullyQualifiedErrorId : CommandNotFoundException 

Any ideas?

like image 227
mare Avatar asked Jul 31 '11 20:07

mare


People also ask

How do I open the package manager console?

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).

How do I clean my package manager console?

Starting in Visual Studio 2017, use the Tools > NuGet Package Manager > Package Manager Settings menu command, then select Clear All NuGet Cache(s).


2 Answers

Rather than voting to close and leaving the answer in comments, it's worth posting it as an actual answer so that others with the problem see an answered question in search results, rather than an unanswered one :-)

Copied from the comments:

restarting the computer and VS somehow fixed this issue, closing

Yes I've seen this issue before (where the NuGet module isn't loaded)

This issue is on the NuGet issue tracker, though it's closed (at the moment)

like image 168
Danny Tuppeny Avatar answered Sep 19 '22 15:09

Danny Tuppeny


The solution to this problem would be:

  1. Close the Package Manager Console
  2. Close the Project
  3. Close Visual Studio
  4. Start Visual Studio
  5. Open the project again
like image 26
sacredseer Avatar answered Sep 22 '22 15:09

sacredseer