There are some scenarios where we need to detect the installed VS edition for our VS Package licence purposes.
The following snippet shows how to detect it and act accordingly.
private SKUEdition GetSKUEdition(IServiceProvider serviceProvider)
{
var shell = serviceProvider.GetService(typeof(IVsShell)) as IVsShell;
object sku;
shell.GetProperty((int)__VSSPROPID2.VSSPROPID_SKUEdition, out sku);
return (SKUEdition)Enum.Parse(typeof(SKUEdition), sku.ToString());
}
internal enum SKUEdition
{
Standard = 1000,
Professional = 2000,
Enterprise = 3000,
}
Pablo