EnvDTE substitute in Visual Studio 2012

允我心安 提交于 2019-11-30 05:29:48

I think you are misunderstanding how EnvDTE versioning works.

Visual Studio is backwards compatible with every version of EnvDTE. But if a new version of Visual Studio requires or exposes additional extensibility, then MS releases a newer version of EnvDTE that exposes this through its interfaces.

So, for example, you could use EnvDTE80 classes to interact with Visual Studio 2012. You are just limited to the extensibility that was available in Visual Studio 2005. Or you could use EnvDTE90, and be limited to that which was available when Visual Studio 2008 came out.

If a newer version of EnvDTE has not been released with the latest VS SDK, then you are limited to EnvDTE100.

Although only envdte100.dll exists in

c:\Program Files (x86)\Common Files\microsoft shared\MSEnv\PublicAssemblies\

the following works for Visual Studio 2012:

Type typeDTE = typeDTE = Type.GetTypeFromProgID("VisualStudio.DTE.11.0");

DTE objDTE = (DTE)Activator.CreateInstance(typeDTE, true);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!