If you are like me, the wizards provided by Visual Studio usually get ignored shortly after you learn the details of developing a given project type. The downside of that is that I might be giving up some little tidbits that the templates take care of for me and are easy for forget.
It seems that when I start development of a new Visual Studio Add-In project (without using the conveniently supplied templates) I always forget one thing and get the following error the first time I deploy:
If you are using C#, the No such interface supported error might make you think immediately of a .Net interface type that Visual Studio is looking for and you have not implemented. I have spent a good deal of time trying to find the problem in my code, when actually the solution is quite simple and is not even in my code at all.
Visual Studio is not a .Net application. It is a native application and exposes its extensibility via COM. The interface that Visual Studio is complaining about is not a .Net interface, but rather a COM interface. Specifically, the IDTExtensibility2 COM interface.
I never seem to have a problem remembering to implement IDTExtensibility2. After all, this interface is the core interface for Add-In development. The one thing I always forget is to make the assembly that implements this interface COM-Visible. In case you have not had to deal with COM interop, this is easy to do and is accomplished via the Assembly Information dialog box (Application tab for the Project Properties).
If you do not mark your assembly as COM-Visible, Visual Studio will not be able to find the IDTExtensiblity2 interface. Hence the dreaded “No such interface supported” error message.

{ 1 comment }
RE: The Dreaded No Such Interface Supported Error
Pingback from Dew Drop – June 25, 2008 | Alvin Ashcraft’s Morning Dew
Comments on this entry are closed.