I am developing an extention for SSMS using VSIX. In this extension I need to know which version of SSMS I am running on. What is the best way to get that?
I do it like this in my SSMS extension (for SSMS 16 and higher)
var dte = GetServiceHelper(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
if (dte == null) return new Version(130, 0, 0, 0);
if (dte.RegistryRoot.Contains("14.0"))
{
return new Version(140, 0, 0, 0);
}
return new Version(130, 0, 0, 0);