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.

Community
  • 1
  • 1
Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062

1 Answers1

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.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • thank you hans, so i should be referencing visual studio development environment 9.0? – Alex Gordon Oct 18 '12 at 19:55
  • No, you should use "VisualStudio.DTE.9.0" – Hans Passant Oct 18 '12 at 19:59
  • thanks so much! i meant when i reference the com object shoudl be "visual studio development environment 9.0" ?? – Alex Gordon Oct 18 '12 at 20:01
  • just using VisualStudio.DTE, does not work. i just downloaded VS 2008 express and 9.0 did not work! – Alex Gordon Oct 18 '12 at 21:32
  • Sigh, of course it doesn't. Express is the free VS edition, it doesn't support anything like add-ins and the extensibility interfaces. – Hans Passant Oct 18 '12 at 21:39
  • thank you. so in this case i cannot run my program at all on a computer that does not have visual studio installed? – Alex Gordon Oct 18 '12 at 21:45
  • Erm, it will surely run on my computer. Like it did for the guy that posted the web page. My machine has th retail edition of Visual Studio installed. I paid the license fee for a crucial tool I use every day to get my job done. If you're trying to make money from nothing then you usually end up with nothing. A principle never well understood in your neck of the woods? – Hans Passant Oct 18 '12 at 21:59
  • i dont understand why the user should be forced to pay for a development tool that they won't even use – Alex Gordon Oct 18 '12 at 22:01
  • That comment is five thousand miles away from anything that would make sense I my neck of the woods. Why are you not hacking Linux + Mono? No strings attached, it is all free. – Hans Passant Oct 18 '12 at 22:10
  • you know the reason i have to pay for the license of VS comes down to the fact that they have a bug in it: http://msdn.microsoft.com/en-us/library/ms228772(v=vs.80).aspx - if it were not for this bug, i would not need to get an extra full version of VS – Alex Gordon Oct 18 '12 at 22:16