The strange case of "No such interface supported" (Error 80004002) loading a Visual Studio add-in

Some days ago I received an angry complaint from a prospect of the trial version of my MZ-Tools add-in, who uninstalled it because, somehow, he didn't want the add-in loaded at startup during the evaluation period but he wanted to load it manually from time to time... Anyway, it happens that my MZ-Tools add-in still uses COM-registration because it shares code and setup with the versions for VS.NET 2002/2003, and therefore is subject to the couple of bugs of the Add-In Managers of VS 2008 and 2005. Of course the blame ended on the Microsoft side but too late, I'm afraid. It is unfortunate to lose sales because of these little problems... so today I started to investigate the migration from COM-registration to XML-registration for the versions of MZ-Tools for VS 2005 and 2008. And after some hours of internal refactoring needed, the .AddIn file created, I was ready to debug the add-in, when I got:

"No such interface supported" (80004002)"

How could that be? I have spent years creating add-ins for samples and I never got that error. A search in Google returned no useful information. At first I thought that it was related to the fact that I didn't want my add-in, which is written in VB.NET, to have a root namespace (for those of you using C#, in VB.NET you can set a project-level property with the root namespace and avoid writting it in each code file), because I don't want my commands to be of the form "MZTools.Connect.MyCommand" but of the form "MZTools.MyCommand", which is possible as I explained in this article.

After some minutes investigating, I discovered that my AssemblyInfo.vb file has the ComVisible attribute set to False, instead of the default True that the add-in wizard creates:

<Assembly: ComVisible(False)>

because it doesn't make sense to expose to COM the classes of an add-in, except the Connect class. And here was the problem: while I had the <ComVisible(True)> attribute attached to the Connect class, when I removed the <Guid(...)> and <ProgId(...)> attributes, which are not required for XML-registration, I removed too the <ComVisible(...)> attribute, because I thought that it was not required for XML-registration, but it happens that it IS required, go figure! I think we'll never get rid of COM in Visual Studio extensibility in a million of years, no matter how hard Microsoft tries to disguise it...

Published Mon, Sep 29 2008 8:02 by carlosq

Comments

# Visual Studio 2005/2008 managed add-ins using XML registration (.AddIn file) and unmanaged satellite DLLs

In my last entry I mentioned that I was investigating to use XML registration (.AddIn File) with my MZ

Wednesday, October 01, 2008 3:08 AM by Carlos Quintero (Microsoft MVP) blog

# re: The strange case of "No such interface supported" (Error 80004002) loading a Visual Studio add-in

Oh man - thanks very much for writing this, it probably would've been several days until I realized about ComVisible. Thanks!!!

Monday, May 18, 2009 8:30 AM by Rob

# Managed add-ins still requiring ComVisible(True) attribute

While add-ins for Visual Studio .NET 2002/2003 required COM registration (COM Interop) and registration

Sunday, June 14, 2009 4:37 PM by Carlos Quintero (Microsoft MVP) blog

# re: The strange case of "No such interface supported" (Error 80004002) loading a Visual Studio add-in

I rarely comment on these sorts of posts, but you just saved me a whole lot of time. Thanks.

Friday, November 13, 2009 1:00 AM by David Noble

# re: The strange case of "No such interface supported" (Error 80004002) loading a Visual Studio add-in

Thanks Dude, I had exactly the same problem after I replaced my AssemblyInfo with a linked SolutionInfo. Without your help, I'd still be banging my mouse! er, well, you get the picture.

Thursday, December 17, 2009 9:21 PM by Steve

# re: The strange case of "No such interface supported" (Error 80004002) loading a Visual Studio add-in

Thanks a lot, got the same error (I am writing my plug in using C#), but same thing. Just needed to check the "Make Assembly COM-Visible" in the "Assemby Information" window in the project properties.

Friday, April 02, 2010 8:55 AM by fernando

# re: The strange case of "No such interface supported" (Error 80004002) loading a Visual Studio add-in

Strangely, I am getting this error while loading Macros IDE. The Add-ins work just fine.

Thursday, April 22, 2010 9:43 AM by Yogesh Sajanikar