Add References Faster with the new Add Reference Dialog in the Productivity Power Tools

Add References Faster with the new Add Reference Dialog in the Productivity Power Tools

Rate This
  • Comments 27

Two weeks ago, we launched the Productivity Power Tools at TechEd North America and the response has been great with over 37000 downloads so far!  Many of you also may have noticed that an updated version of the Power Tools was released last week.  This update fixed an issue where the extension update check would fail on machines that required proxy credentials and cause Visual Studio to crash.

One of my favorite extensions in the set has to be the new Add Reference extension because it saves me time every day. When you first open the Add Reference Dialog, you'll notice a small window that pops up to indicate that it is "Refreshing References".  While this window is up, the dialog is generating a cache of your references for the current framework. It's a little slow to cache the references but once that's done, the dialog should open almost instantly. You will only see this window when a cache update is needed: when you first use a new framework, after installing a new SDK, or when you get an updated build of the Pro Power Tools.

Refreshing References in the Pro Power Tools Add Reference Dialog

The Add Reference extension also includes one of the top customer requests that we received while developing Visual Studio 2010:  search. The new search box in the upper right hand corner of the dialog allows you to perform a substring search over all of the items in the current pane.  This avoids having to navigate through the large list of assemblies and helps you find an assembly even if you can't remember its full name.

Search Box of Visual Studio 2010 Add Reference Dialog

For Visual Studio 2010 Beta 2, we made the choice to change the default tab for the Add Reference dialog to the Project tab as a way to mitigate the performance of the .NET Tab. Now that we've improved the performance of all of the panes in the new Add Reference Dialog, we made the choice to switch this back to the Assemblies pane. We've received quite a bit of feedback from people who preferred the Projects tab, which I'd like to understand better.  In my experience most of the references that are added to my projects are from the assemblies tab and project-to-project references are less common. Are there other benefits to starting with the Projects pane?  Please leave us comments on this post so we can tune the default tab experience.

Finally, I would like to thank Kieran Mockford & Ion Todirel for their hard work on the Add Reference dialog extension. Their effort (much of it during their spare time) has greatly improved the experience of adding references for everyone. 

Sean Laberee
Program Manager Lead
VSPro Team

Leave a Comment
  • Please add 2 and 1 and type the answer here:
  • Post
  • Hi, i don't what is the general rule, but in our company most libraries that we depend on are never registered in the GAC.

    We want to be able to checkout any version from our repository and be able to build it immediately on a clean Windows+VS20xx install or Windows+SDK on our build server.

    The consequence is that most of our references are for files and secondary to projects, nearly never for anything in the Assemblies tab. Even for things like MS Office we build against private versions of the PIA committed in our repository. The only assemblies we depend on are framework ones and the one we use are automatically added by Visual Studio (Windows Forms, WPF, Linq, Xml, Xaml)

  • Thanks for the great extension! Please, may you (or anyone from the teem) leave comments on Q and A page of the extension.

    There's a lot of suggestions and bugs feedbacked (e.g. the Add Reference dialog misses <HintPath/> tag), but no visible reaction on them.

    Sadly, most extensions published by Microsoft publisher or by Microsoft employee has the same nasty support level. The recommendation to download the sources and to fix it by myself (proposed by GoToDef author) is not the way you get more downloads. Believe me.

  • I agree with VirtualBlackFox. The majority of my references are to projects included in the solution itself or we track all 3rd party references locally in source control, so that would be a browse op in the reference dialog. Occasionally, I need to reference an existing .NET framework assembly, but that is not nearly as often as the other cases. This is even more the case now that the "Copy References" feature is available in PowerCommands.

  • If you're not a Microsoft developer working on Microsoft projects, you tend to have a fair number of references to non-Microsoft assemblies. And those are often projects in the same solution. Why wouldn't they be? It's by far the most convenient option.

  • VirtualBlackFox,

    It's actually quite a common misconception that the Add Reference dialog looks for assemblies in the GAC.  Instead, Visual Studio actually looks for assemblies in folders that are registered under the AssemblyFoldersEx registry key (see msdn.microsoft.com/.../wkze6zky.aspx for details).

    Sinix,

    Sorry about the slow response on a few of the threads.  We are looking into the <HintPath /> issue but we don't have a fix for it yet as the bug appears to be in the Visual Studio API that the add reference extension is using.

    Everyone,

    Thank you for letting me know how important the projects tab is for your references. Is there anyone out there that would prefer we keep it the .NET Assemblies tab?

    -Sean Laberee

  • In my case I use the "projects" tab of the reference dialog far more than the "assemblies" one. The solutions I work with typically contain 5-20 projects, and the references between them are the most common references to add; I rarely use "standard" assemblies beyond those that are added automatically from the project template or are imported automatically from the "Add Item" dialog.

    Long story short: some people will like to have the "project" tab as default tab of the reference dialog, others may prefer the "assemblies" tab. To me the solution is to make it an explicit user preference, where the user can specify what to use as default in the preference dialog. Or even better: persist the last selected tab, and re-open the dialog at that last used tab after VS is freshly started (this behaviour is of course already present as long as VS isn't restarted) - that strategy automatically adjusts to the user's usage pattern...

  • Hi,

    Yes i read about from where the assemblies are taken recently on a blog (maybe this one?) and i don't know why i spoke about the GAC... The habit maybe as i believed that for a long time.

    Anyway i don't think that it is really important : When we do a clean checkout of all our source code (from an old branch or from a feature branch) this list doesn't change, so except for framework assemblies we absolutely need to avoid using it as it add a dependency on the current developer environment to something that every developer should be able to do without any computer configuration.

    As Luc Cluitmans said, just persisting the selected tab when the dialog is re-opened will be perfect.

  • I'm not bothered about which tab the dialog starts on, but what I would like is for the dialog to remember its size between invocations.  If it persisted that size between runs of Visual Studio that would be even better.

  • Totally agree with VirtualBlackFox. References to standard assemblies are added by VS; 3rd party assemblies are placed locally in our projects and so the most common references I add are project references and file references (the former ones typically only at the project's start when I setup the solution structure).

    HTH, Ooh

  • Thanks for all of the feedback.  We'll be making the change to have the Add Reference dialog default to the project tab in the next version.  It should also remember which tab you last used after that first initial session.

    -Sean Laberee

  • Hi Sean,

    I have a suggested approach for project references listed here on Connect for the last 3.5 years: connect.microsoft.com/.../ViewFeedback.aspx

    This alternative approach could reduce the need to even open the references dialog.

    -- Tatham

  • a) Is there a better place than these comments to leave bug reports?

    b) Keyboard shortcuts are lacking. _Add, _Close, Sort By, Browse, File name, ...

    c) The dll Path in the hover tooltip should be shown on the preview pane.

    d) Please allow the resize to work like a standard window (e.g. have a system menu, maximize, restore).

    e) Please allow incremental search (e.g. "s.w.s" finds System.Web.Services).

  • First, the assemblies on the .NET tab should always be shown in sorted order. I currently (without these Power Tools) must repeatedly click on the Component Name tab until it starts sorting otherwise it very difficult to find a given assembly.

    I'd love to see a feature that allows me to just start typing and the list of available assemblies would get shorter and shorter, just like VS2010 intellisense does in the code window. It should show just those assemblies that _contain_ the text I've typed.

    As to the default tab, why not just make the Add References tab sticky? Whatever tab I was on when I last closed the Add References dialog should be the tab I get when I reopen it.

    Either that or simply add a configuration option in Tools > Options and let me select which tab to default to when Add References is opened. I would prefer the Recent tab to be my default.

    +1 for remembering the last size of the Add References dialog. Why does it have to default to the size of a postage stamp anyway?

    <Todd />

  • I love the new Add References window, but I have a few things I'd like to see changed:

    1) When I start typing directly after the window opens, use search, not the file path textbox as default. How often will you actually type the full path of an assembly?!

    2) If there's some text in the file path textbox and you select one or more assemblies in the listbox and click add, strange things happen ;)

    3) If I add an assembly that is already in the project references, but it cannot be resolved, remove the old reference and add the new one! Now I need to first remove it, remember the name, then search for it and add it again...

    4) Build a Resolve missing references feature into the window! Show a tab of faulty references, and use the search feature to suggest possible replacement assemblies (based on the name).

    Thanx for what you've given us so far... Looking forward to the next version!

    Jesse

  • In addition to the options of getting assemblies from the present tabs; Projects, Recent, COM and Assemblies, I miss the option of getting assemblies from TFS Source Control.

    In my team we use self-created templates to create new projects/solutions, and these templates include several self-created assemblies. When these assemblies are updated, the templates' references should be updated accordingly getting the newest version of the added references.

Page 1 of 2 (27 items) 12