Alex Gordon
Alex Gordon

Reputation: 60731

how to properly GetTypeFromProgID for visual studio 2008

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.

Upvotes: 0

Views: 3734

Answers (1)

Hans Passant
Hans Passant

Reputation: 941455

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.

Upvotes: 6

Related Questions