I spent a couple of hours to learn how to write add-ins for SQL Server Management Studio (SSMS). Microsoft never officially supported add-ins in SSMS but Redgate created a framework to help doing it hiding a lot of complexity. The nice thing is that this framework has being made available to everyone and it can be used to create add-ins for all versions of SSMS up to SSMS 2014 (SSMS 2016 finally add support for extensions as it is based on Visual Studio 2015 Isolated Shell even if I can’t find documentation on it yet).
You can find documentation on the SIP Framework at the following address:
https://documentation.red-gate.com/display/MA/SSMS+ecosystem+project
You can follow the instructions very easily and in a matter of minutes you will be able to get the sample add-in up and running in your SSMS. Debugging it from Visual Studio is also incredibly simple to do (and you can also edit and continue!). The idea is pretty simple, you install the framework, you add a registry key that points to your add-in dll and when you open SSMS the add-in will load.
The sample project really helped me to quickly understand how to add menu bars, toolbar buttons, menu items in the object explorer and opening query windows. There is no much information on the Internet on how to actually interact and managed the status of SSMS. I think I will learn more over time but I suspect that most of the job consist of doing some reverse engineering of the API and use of reflection. This is an article that go a bit deeper: The art and science of creating SSMS 2012 add-ins.
Redgate products are using this SIP Framework under the covers and there is a list of add-ins available from Redgate and third party companies at the following address http://www.red-gate.com/products/sql-development/add-ins
Hello Andrea,
I’m curious if you’ve found information on programming SSMS 2016 add-ins that you could share. I’ve searched and I am coming up empty.
Francis
It’s really hard to find information on that. SSMS 2016 use the Visual Studio shell under the covers so developing a plug-in is different. However sometimes you need to use a bit of reflection as API are not exposed directly. Unfortunately I don’t have direct experience in writing plugins for SSMS 2016 but I know it is possible as many Redgate tools do it. I’ll consider blogging about it, if I decide to investigate more about it. I really hope Microsoft will make this easier in the future with plenty of public documentation. Sorry for not being more helpful.