Detect the Visual Studio version inside a VSPackage
问题 How can I check/detect which Visual Studio version is running under my VSPackage? I cannot get from the registry because the computer could have several versions installed, so I guess there is an API that is able to get it. Anybody knows how to get it from a managed Visual Studio package using C#? 回答1: You could try to get version via automation DTE object . In MPF you could get it in this way: EnvDTE.DTE dte = (EnvDTE.DTE)Package.GetGlobalService(typeof(EnvDTE.DTE)); There are some other