简体   繁体   中英

How to use Type.GetTypeFromProgID() for Visual Studio 2015 Community Edition

I am trying to get Type for Visual Studio 2015 Community Edition as under but result (type) is always null.

System.Type type = Type.GetTypeFromProgID("VisualStudio.DTE.15.0", false);

EnvDTE.DTE dte = (EnvDTE.DTE) System.Activator.CreateInstance(type);

While the product name is Visual Studio 2015, the version number is 14.0 . So try:

"VisualStudio.DTE.14.0"

(I do not have a chance to check Community Edition, but at least it works with my VS 2015 Professional.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM