Monday, July 19, 2010

Windows 7 Jump Lists and Visual Studio 2010


The jumplists in Visual Studio 2010 should display in the Recent Items list the most recently used projects and solutions. The list should be similar with the MRU list displayed on the StartPage, and with the project list in Files/RecentProjectsAndSolution menu.

Projects and Solutions are automatically added to the list by Windows on behalf of Visual Studio when projects are double-clicked in Windows Explorer, or when are opened using the standard File/Open/Project dialog. The items also end up in this list when Visual Studio calls explicitly SHAddToRecentDocs() with the file name.

We had reports that Recent items list in jump lists don’t display all the projects and solutions displayed by the other lists (as demonstrated below), without the user doing anything special like explicitly removing the items from Windows’ jump list.


It may be possible at times that Visual Studio 2010 jump lists don’t show any projects and solutions, as shown in this picture:



There may be a couple of explanations to this:

1) In Windows, the display of Recent Items and the number of items in the list are controlled by a couple of settings accessible in Taskbar properties. These settings may be modified by mistake or may be mismatched with the Visual Studio settings for the number of recent items.

Right click the taskbar, choose Properties, then in  StartMenu tab look for “Store and display recently opened items in the Start menu and the taskbar” checkbox. Make sure the checkbox is checked.


The number of recent items in the jumplist is controlled by a different setting. Right click the taskbar, choose Properties, then in  StartMenu tab click the Customize button. In the dialog that opens, look for the “Number of recent items to display in Jump lists”. Make sure the number of items is not set to 0 (zero) by mistake. The default value is 10.


The Visual Studio similar setting for the number of items to show in MRU lists (e.g. the recent projects list from the StartPage) can be accessed via Tools/Options dialog, under Environment/General category. The default is also 10 items shown in recently used lists.



2) The projects shown in Visual Studio recent projects lists may have been created in temporary locations.

By design, Windows 7 jump lists don’t show recent items that are created in temporary folders. This makes sense - no items in temp folders are ever added to Jump Lists or the Recent Items Folder, because Jump Lists and Recent Items are about getting back to important items, and by definition a temporary file is not something that users want to get back to.

The recent projects lists in Visual Studio’s StartPage and File menu don’t have the same restriction. You can easily see if the projects missing from jumplists are in temporary folder by hovering over the items in the StartPage and looking at the tooltips.


3) You’re running multiple Visual Studio instances, under different registry hives and their jump lists clash.

This may happen if you’re creating projects extending Visual Studio and have installed Visual Studio SDK.

Here you see I’m running 2 instances of Visual Studio, one of them started under Experimental Hive. The instances have different MRU settings (stored in registry under different hives), colors, etc. but they share the same icon in Windows taskbar and they share the jump list.


This is a VS10 bug we need to fix for next version of Visual Studio. VS started under the experimental hive needs to use a different AppUserModelID to have a different icon and have a separate jump list.

4) You’ve created your own shortcuts to devenv.exe and are starting Visual Studio using those shortcuts.

Visual Studio uses a custom AppUserModelID (e.g. for VS Pro and Ultimate this is “VisualStudio.10.0”), and for jump lists to work correctly this model id needs to be set on all User Interface elements of the application (windows, shortcuts, etc). The shortcut created when Visual Studio was installed has the correct property (System.AppUserModel.ID) set. However, any new shortcuts you create won’t have the property, and Windows may or may not display correctly the jumplists when starting Visual Studio using one of those shortcuts.

If you need more shortcuts to devenv.exe it is recommended to copy the shortcut created when Visual Studio was installed on the computer.

5) Mysterious jump lists disappearance/appearance.

We also had reports of jump lists mysteriously disappearing or reappearing (usually when upgrading the Visual Studio build from one daily build to another, or when upgrading say from beta or the RC build to the RTM version of Visual Studio 2010). Often times it just starts working, usually when opening a file from Windows Explorer by double clicking it, or by rebooting the machine.

So far we do not have a consistent repro, and we are only suspecting a Windows bug that Windows doesn’t correctly calculate the app user model ID associated with the running application calling SHAddToRecentDocs for a specific file extension (like *.sln).

Should this be indeed the case, you will be able to workaround it by declaring an explicit AppUserModelID for the ProgID used by the VisualStudio files.

E.g. for Visual Studio Professional / Premium / Ultimate, save the section below as a *.reg file and import it into registry.


Windows Registry Editor Version 5.00









For Visual Studio Express SKUs you’ll need entries like the ones below (the example is for C# Express)


Windows Registry Editor Version 5.00



You may need to replace the application names to match the Express SKU type you have installed, and the project files extensions used by that Express SKU.


Microsoft Visual C# 2010 Express: “VCSExpress” name, “csproj” file extension.

Microsoft Visual Basic 2010 Express: “VBExpress” name, “vbproj” file extension.

Microsoft Visual C++ 2010 Express: “VCExpress” name, “vcproj” and “vcxproj” file extensions.

Microsoft Visual Web Developer 2010 Express: “VWDExpress” name, “csproj” and “vbproj” file extensions.