Kevin Boyle

Trying to build products people love using interesting technologies

User Notifications in the Visual Studio 2013 SDK

My day job involves a lot of integration with Microsoft IDEs, mostly SQL Server Management Studio and the various flavours of Visual Studio.

Visual Studio 2013 has now been released so I can begin to explore some of the new features from an extensibility point of view.

One of the more interesting additions is the concept of user notifications, which is a central location where Visual Studio can show you notifications around updates or anything else that might be relevant to you.

This feature isn’t open for extensibility, but with the aid of .NET Reflector I was able to check out how this feature behaves.

The main functionality is accessed via a new type that has been introduced:

public interface IVsUserNotificationsManager
    IVsUserNotification AddUserNotification(Guid Provider, string Identifier, string Title, string Description, uint Severity, object Context, DateTime Expiration, bool isTransient);
    bool RemoveUserNotification(IVsUserNotification notification);
    void PromoteUserNotification(IVsUserNotification notification, uint Severity);
    IVsEnumUserNotifications GetUserNotifications(Guid Provider, uint filter, string Identifier);

To investigate how to use this new interface, I created a sample that fetches pictures from Reddit and adds them to the notification panel. You can find the source for this package on GitHub. It is easy to follow and the Visual Studio team have done a good job of creating simple interfaces. Looking forward to when this gets opened up for extensibility.

This is pure speculation, but I suspect the reason that Microsoft haven’t officially opened this up as an extensibility point is that notifications can be tiresome for a user and getting the experience just right so that they provide valuable information without being too spammy is a difficult balance. Please don’t use this feature in any extensions you write, I just hacked this sample together to show how it worked.

Reddit & VS2013