how to properly GetTypeFromProgID for visual studio 2008

0

I am following the instructions here:

http://msdn.microsoft.com/en-us/library/ms228772(v=vs.80).aspx

for .net 3.5 visual studio 2008 to fix this issue:

call was rejected by callee

for this line of code:

t = System.Type.GetTypeFromProgID("VisualStudio.DTE.8.0",
              true);

I am getting this error:

COMException was unhandled: Invalid class string (Exception from HRESULT: 0x800401F3 (CO_E_CLASSSTRING))

Does anyone know what this means, and what am I doing wrong?

thank you so much for your guidance.

c#
.net
visual-studio-2008
interop
envdte
asked on Stack Overflow Oct 18, 2012 by Alex Gordon • edited May 23, 2017 by Community

1 Answer

6

Your code doesn't match the tag you used. VS2008 is Visual Studio version 9.0. So the proper progid is VisualStudio.DTE.9.0. The full list of version numbers:

  • VS2002 : 7.0
  • VS2003 : 7.1
  • VS2005 : 8.0
  • VS2008 : 9.0
  • VS2010 : 10.0
  • VS2012 : 11.0
  • VS2013 : 12.0

You can also use the VisualStudio.DTE progid. You'll get whatever version of VS was installed last. A bit random.

answered on Stack Overflow Oct 18, 2012 by Hans Passant • edited Jul 19, 2014 by Hans Passant

User contributions licensed under CC BY-SA 3.0