Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

This is the twenty-third in a series of blog posts I’m doing on the VS 2010 and .NET 4 release.

Today’s blog post covers some of the extensibility improvements made in VS 2010 – as well as a cool new "PowerCommands for Visual Studio 2010” extension that Microsoft just released (and which can be downloaded and used for free).

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

Extensibility in VS 2010

VS 2010 provides a much richer extensibility model than previous releases.  Anyone can build extensions that add, customize, and light-up the Visual Studio 2010 IDE, Code Editors, Project System and associated Designers.

VS 2010 Extensions can be created using the new MEF (Managed Extensibility Framework) which is built-into .NET 4.  You can learn more about how to create VS 2010 extensions from this this blog post from the Visual Studio Team Blog.

VS 2010 Extension Manager

Developers building extensions can distribute them on their own (via their own web-sites or by selling them). 

Visual Studio 2010 also now includes a built-in “Extension Manager” within the IDE that makes it much easier for developers to find, download, and enable extensions online.  You can launch the “Extension Manager” by selecting the Tools->Extension Manager menu option:

image

This loads an “Extension Manager” dialog which accesses an “online gallery” at Microsoft, and then populates a list of available extensions that you can optionally download and enable within your copy of Visual Studio:

image

There are already hundreds of cool extensions populated within the online gallery.  You can browse them by category (use the tree-view on the top-left to filter them).  Clicking “download” on any of the extensions will download, install, and enable it.

PowerCommands for Visual Studio 2010

This weekend Microsoft released the free PowerCommands for Visual Studio 2010 extension to the online gallery.  You can learn more about it here, and download and install it via the “Extension Manager” above (search for PowerCommands to find it).

The PowerCommands download adds dozens of useful commands to Visual Studio 2010.  Below is a screen-shot of just a few of the useful commands that it adds to the Solution Explorer context menus:

image

Below is a list of all the commands included with this weekend’s PowerCommands for Visual Studio 2010 release:

  • Enable/Disable PowerCommands in Options dialog
    This feature allows you to select which commands to enable in the Visual Studio IDE. Point to the Tools menu, then click Options. Expand the PowerCommands options, then click Commands. Check the commands you would like to enable.
    Note: All power commands are initially defaulted Enabled.

  • Format document on save / Remove and Sort Usings on save
    The Format document on save option formats the tabs, spaces, and so on of the document being saved. It is equivalent to pointing to the Edit menu, clicking Advanced, and then clicking Format Document. The Remove and sort usings option removes unused using statements and sorts the remaining using statements in the document being saved.
    Note: The Remove and sort usings option is only available for C# documents. Format document on save and Remove and sort usings both are initially defaulted OFF.
  • Clear All Panes
    This command clears all output panes. It can be executed from the button on the toolbar of the Output window.
  • Copy Path
    This command copies the full path of the currently selected item to the clipboard. It can be executed by right-clicking one of these nodes in the Solution Explorer:
    The solution node; A project node; Any project item node; Any folder.
  • Email CodeSnippet
    To email the lines of text you select in the code editor, right-click anywhere in the editor and then click Email CodeSnippet.
  • Insert Guid Attribute
    This command adds a Guid attribute to a selected class. From the code editor, right-click anywhere within the class definition, then click Insert Guid Attribute.
  • Show All Files
    This command shows the hidden files in all projects displayed in the Solution Explorer when the solution node is selected. It enhances the Show All Files button, which normally shows only the hidden files in the selected project node.
  • Undo Close
    This command reopens a closed document , returning the cursor to its last position. To reopen the most recently closed document, point to the Edit menu, then click Undo Close. Alternately, you can use the CtrlShiftZ shortcut.
    To reopen any other recently closed document, point to the View menu, click Other Windows, and then click Undo Close Window. The Undo Close window appears, typically next to the Output window. Double-click any document in the list to reopen it.
  • Collapse Projects
    This command collapses a project or projects in the Solution Explorer starting from the root selected node. Collapsing a project can increase the readability of the solution. This command can be executed from three different places: solution, solution folders and project nodes respectively.
  • Copy Class
    This command copies a selected class entire content to the clipboard, renaming the class. This command is normally followed by a Paste Class command, which renames the class to avoid a compilation error. It can be executed from a single project item or a project item with dependent sub items.
  • Paste Class
    This command pastes a class entire content from the clipboard, renaming the class to avoid a compilation error. This command is normally preceded by a Copy Class command. It can be executed from a project or folder node.
  • Copy References
    This command copies a reference or set of references to the clipboard. It can be executed from the references node, a single reference node or set of reference nodes.
  • Paste References
    This command pastes a reference or set of references from the clipboard. It can be executed from different places depending on the type of project. For CSharp projects it can be executed from the references node. For Visual Basic and Website projects it can be executed from the project node.
  • Copy As Project Reference
    This command copies a project as a project reference to the clipboard. It can be executed from a project node.
  • Edit Project File
    This command opens the MSBuild project file for a selected project inside Visual Studio. It combines the existing Unload Project and Edit Project commands.
  • Open Containing Folder
    This command opens a Windows Explorer window pointing to the physical path of a selected item. It can be executed from a project item node
  • Open Command Prompt
    This command opens a Visual Studio command prompt pointing to the physical path of a selected item. It can be executed from four different places: solution, project, folder and project item nodes respectively.
  • Unload Projects
    This command unloads all projects in a solution. This can be useful in MSBuild scenarios when multiple projects are being edited. This command can be executed from the solution node.
  • Reload Projects
    This command reloads all unloaded projects in a solution. It can be executed from the solution node.
  • Remove and Sort Usings
    This command removes and sort using statements for all classes given a project. It is useful, for example, in removing or organizing the using statements generated by a wizard. This command can be executed from a solution node or a single project node.
  • Extract Constant
    This command creates a constant definition statement for a selected text. Extracting a constant effectively names a literal value, which can improve readability. This command can be executed from the code editor by right-clicking selected text.
  • Clear Recent File List
    This command clears the Visual Studio recent file list. The Clear Recent File List command brings up a Clear File dialog which allows any or all recent files to be selected.
  • Clear Recent Project List
    This command clears the Visual Studio recent project list. The Clear Recent Project List command brings up a Clear File dialog which allows any or all recent projects to be selected.
  • Transform Templates
    This command executes a custom tool with associated text templates items. It can be executed from a DSL project node or a DSL folder node.
  • Close All
    This command closes all documents. It can be executed from a document tab.

How to temporarily disable extensions

Extensions provide a great way to make Visual Studio even more powerful, and can help improve your overall productivity.  One thing to keep in mind, though, is that extensions run within the Visual Studio process (DevEnv.exe) and so a bug within an extension can impact both the stability and performance of Visual Studio. 

If you ever run into a situation where things seem slower than they should, or if you crash repeatedly, please temporarily disable any installed extensions and see if that fixes the problem.  You can do this for extensions that were installed via the online gallery by re-running the extension manager (using the Tools->Extension Manager menu option) and by selecting the “Installed Extensions” node on the top-left of the dialog – and then by clicking “Disable” on any of the extensions within your installed list:

image

Hope this helps,

Scott

Published Monday, May 3, 2010 10:34 PM by ScottGu

Comments

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 1:52 AM by Silverlight Developer

Scott, is there any update on when a re-release/update of SL4 is going to happen to fix the large memory leaks?

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 2:04 AM by Lohith

Hey Scot

As usual a supppppeeeerrrr post.

Good coverage on the topic. Thanks once again. Looking forward to more of these

Lohith

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 2:20 AM by mohanbrij

Thats really a great feature, Thanks for the nice post.

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 2:27 AM by ScottGu

@Silverlight Developer,

>>>>>> Scott, is there any update on when a re-release/update of SL4 is going to happen to fix the large memory leaks?

What memory leak?  Can you send me email (scottgu@microsoft.com) with more details of what you are seeing?

Thanks,

Scott

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 2:51 AM by rajbk

The "Remove and Sort Usings" recursive is awesome! Thanks.

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 2:58 AM by Ming

Dear scott, when is the chinese version of vs2010 release? thanks

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 3:16 AM by ScottGu

@Ming,

>>>>> when is the chinese version of vs2010 release?

The chinese versions of VS 2010 will be released this June.

Hope this helps,

Scott

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 3:32 AM by Sid

Nice post, Scott. Some awesome features there.

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 4:19 AM by Alex

The extension manager will be excellent once all of the spam from Component One and their ilk is removed.

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 5:39 AM by shou

I want to know what is the difference between Add-in and Extension.

When should we build Extension ?

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 7:31 AM by TB

Great post.  Does the Extension Manager not work in VWD 2010 Express?

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Tuesday, May 4, 2010 6:04 PM by shailatlas

Hello Scott,

Is there some for SharePoint Development also. Specially the one which allows me to do IISRESET from IDE ?

Thanks

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Wednesday, May 5, 2010 1:06 AM by nic

Thanks,Scott, The plugin will save my time .

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Wednesday, May 5, 2010 2:09 AM by Kobi

It looks that this handy extension does not work in Express versions of VS 2010.

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Wednesday, May 5, 2010 2:32 AM by gsuttie2002

Why does the command prompt tool as part of this open saying:-

Setting Environment for using Microsoft Visual Studio 2008 x86 tools - I was hoping/expecting the VS 2010 command prompt

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Wednesday, May 5, 2010 6:31 AM by Nicolas Esprit

Nice post, Scott.

Thanks :-)

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Thursday, May 6, 2010 3:52 AM by Dinesh

XamlWriter will support silverlight 4

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Thursday, May 6, 2010 3:22 PM by RichardD

Am I the only one seeing this? If I have previously opened any project, closed it, and then use the Extension Manager to install, uninstall, enable or disable an extension, when VS2010 restarts it loads the previous project. It usually seems to load the most recently closed project, but I have seen it load other projects which I had opened during the session.

It's only a small annoyance, but I would expect the restart to restore the empty environment I had before restarting, not pick a random project and load it!

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Thursday, May 6, 2010 7:03 PM by guruward

can someone fix the SSMS install :)

installing vs2010 half loaded SQL Server 2008 express with no SMSS arggg

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Friday, May 7, 2010 3:03 AM by zire

Nice sample of thanks :)

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Sunday, May 9, 2010 6:21 AM by firasr

I keep get the following error when trying to connecting to Online Gallery on Extension Manager:

"A connection to the server could not be established because the following error occurred: The server has returned invalid data. Please try again later."

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Wednesday, May 26, 2010 6:11 PM by om

Cannot be installed if you have Visual Web Developer (VWD) 2010.

# re: Visual Studio 2010 Extension Manager (and the new VS 2010 PowerCommands Extension)

Sunday, June 13, 2010 4:32 PM by Jaap Taal

I'm searching for PowerCommands in the Extension Manager, but can't find it. Is it not available in Visual Web Dev 2010?